+ Reply to Thread
Results 1 to 3 of 3

How do you make macro shortcuts call the right macro

  1. #1
    Registered User
    Join Date
    02-29-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    33

    How do you make macro shortcuts call the right macro

    Hi,

    I create a macro shortcut (usually attached to CTRL and M) to move to the key tab of excel workbooks I create.

    The problem is when I have 2 workbooks open that both have the CTRL-M macro pointing to different sheets, because hitting CTRL-M often triggers the wrong version of the macro.

    What can I do to make macros linked to keyboard shortcuts, run the version of the macro in the book that is currently focused?

    Thanks so much for your help.

    Ana

  2. #2
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    1,980

    Re: How do you make macro shortcuts call the right macro

    One way would be to have the macro in a separate sub and then call it from the recorded one with the shortcut specifying the workbook.
    So for example.
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    02-29-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    33

    Re: How do you make macro shortcuts call the right macro

    Thanks ByteMarks. I can see that that would work, but is there a better way? Maybe some setting to direct excel to only look in the active workbook?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Saving Word Tempates to include Macro and Macro Shortcuts
    By JimmyWilliams in forum Word Formatting & General
    Replies: 17
    Last Post: 08-27-2017, 11:45 PM
  2. Replies: 2
    Last Post: 08-13-2014, 06:39 PM
  3. Macro shortcuts & VBA
    By kayard in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-14-2007, 11:11 AM
  4. Macro Shortcuts
    By Jzfromltown in forum Excel General
    Replies: 1
    Last Post: 12-12-2006, 05:09 PM
  5. How to make a cell containing a macro call to be recalculated?
    By Luis Piñeiro in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-30-2006, 08:35 AM
  6. [SOLVED] Macro shortcuts
    By Don Wiss in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-21-2006, 07:40 PM
  7. How do I make a macro call on different macros
    By fubr69z in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-03-2005, 07:10 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1