Assigning a Macro to a Keyboard Combination

Written by Allen Wyatt (last updated January 29, 2022)
This tip applies to Excel 97, 2000, 2002, and 2003


Excel allows you to assign macros to specific key combinations. These key combinations are referred to as shortcut keys, and when used they result in the macro being executed. If you want to assign or change a key combination associated with a macro, you can follow these steps:

  1. Choose the Macro option from the Tools menu, then choose Macros from the resulting submenu. This displays the Macro dialog box. (See Figure 1.)
  2. Figure 1. The Macro dialog box.

  3. From the list of available macros, select the macro whose shortcut key you want to change.
  4. Click on Options. Excel displays the Macro Options dialog box. (See Figure 2.)
  5. Figure 2. The Macro Options dialog box.

  6. In the Shortcut Key area, indicate the key you want used with the Ctrl key as your shortcut. For instance, if you want Ctrl+Y to execute your macro, then enter a Y in the Shortcut Key area.
  7. Click on OK to close the Macro Options dialog box.
  8. Click on Cancel to close the Macro dialog box.

Note:

If you would like to know how to use the macros described on this page (or on any other page on the ExcelTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2714) applies to Microsoft Excel 97, 2000, 2002, and 2003.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Emoticons in Word

Like to add a smiley or two to your writing? Word makes it easy through creative use of the AutoCorrect feature.

Discover More

Retaining Explicit Formatting after Applying Styles

The formatting in a document is often a mix of styles and explicit formatting, applied over time. You may want to apply ...

Discover More

Full-Width Headers and Footers in Excel

Excel allows you to create headers and footers. In this tip you discover that the headers and footers in Excel may not be ...

Discover More

Excel Smarts for Beginners! Featuring the friendly and trusted For Dummies style, this popular guide shows beginners how to get up and running with Excel while also helping more experienced users get comfortable with the newest features. Check out Excel 2013 For Dummies today!

More ExcelTips (menu)

Retrieving Drive Statistics

Need to gather some information about the drives on a system? It can be pretty easy to do using a macro, as shown in this ...

Discover More

Exiting a For ... Next Loop Early

If you use For ... Next loops in your macros, make sure you give a way to jump out of the loop early. That way you can ...

Discover More

Opening a Workbook but Disabling Macros

Macros that run automatically when you open or close a workbook are quite helpful. You may not want them to run, however, ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 2 + 2?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.