Results 1 to 2 of 2

Thread: Assign Shortcut To Macro To Be Available For All Active Workbooks

  1. #1
    Junior Member
    Join Date
    Dec 2012
    Posts
    8
    Rep Power
    0

    Assign Shortcut To Macro To Be Available For All Active Workbooks

    Dear All,

    I need a help i use certain macros several times in a day.Actually i want to create a short-cut for those macros.

    For Eg: i use this below mentioned macro function to console all the sheets of a worksheet.

    Code:
    Sub Combine()
    '
    ' Developed by PCS_Help
    ' For immediate help goto PCS_Help - CrossLoop Expert in Most problems. Windows XP, Server, Vista, Office, Word, Excel, Access, Outlook, Powerpoint, Publisher, VBA, Quickbooks, ...
    '
    Dim NumSheets As Integer
    Dim NumRows As Integer
    
    ' Change the value of NumSheets to equal the number of sheets you wish to combine
    NumSheets = 173
    
    ' Change the value of NumRows to equal the number of rows in each sheet
    NumRows = 43
    
    Worksheets(1).Select
    Sheets.Add
    ActiveSheet.Name = "Consolidated"
    For X = 1 To NumSheets
    Worksheets(X + 1).Select
    Rows("1:" & NumRows).Select
    Selection.Copy
    Worksheets("Consolidated").Select
    ActiveSheet.Paste
    Selection.End(xlDown).Select
    ActiveCell.Offset(1, 0).Select
    Worksheets(X + 1).Select
    Range("A1").Select
    Next X
    Worksheets("Consolidated").Select
    Range("A1").Select
    End Sub
    What i do is open the excel file press alt+f11 then i click on insert then module then i paste the above formula and run it this consolidates each sheet of my file.
    I do this daily and on different files what i want is create a short cut for this formula short-cut for eg ctrl+shift+O to run this macro.
    Can you please help with the procedure as there are few more formulas for which i have to assign short cut.
    Please help.

    Thanks & Regards

    Nitin Shetty.
    Last edited by Excel Fox; 03-30-2013 at 11:46 PM. Reason: Code Tags

  2. #2
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,402
    Rep Power
    10
    Nitin, please use code tags, to wrap your code. It makes more legibility.

    Now, why don't you save your code in the Personal file, and manually assign a hot key. That way, it will always remain the way you've assigned, without having to do it again and again.
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

Similar Threads

  1. Replies: 2
    Last Post: 05-23-2013, 02:53 PM
  2. Save each Worksheets as Macro disabled workbooks
    By nickface in forum Excel Help
    Replies: 1
    Last Post: 01-28-2013, 07:47 AM
  3. shortcut key to list of macros
    By Rasm in forum Excel Help
    Replies: 4
    Last Post: 01-10-2013, 03:19 PM
  4. Replies: 2
    Last Post: 11-08-2012, 01:15 PM
  5. Assign an event to chart on workbook open
    By LalitPandey87 in forum Excel Help
    Replies: 2
    Last Post: 02-20-2012, 07:43 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •