In Microsoft Excel, how do I assign a shortcut key to a macro?
In Microsoft Excel, it is often easier to assign a macro to a shortcut
key combination (e.g., in Windows, Ctrl-r , and in
Mac OS X, Option-Command-r) than to a
button. You can assign the key when you create the macro or after
you've created it. Follow the appropriate directions below.
Assigning a shortcut to a new macro
- In Excel 2010 and 2007, from the
Viewtab, clickMacros, and then selectRecord Macro.... TheRecord Macrodialog box will appear.In Excel 2003 and earlier, from the
Toolsmenu, selectMacro, and thenRecord New Macro.... - In the "Macro name:" field, enter a name for your macro.
- In the "Shortcut key:" field, choose the key you would like to
press in conjunction with the
Ctrlkey (in Mac OS X,Option-Command) to trigger the macro. This can be any key, but you should check the key combination before assigning it to a macro. Excel has some predefined key combinations that you will erase if you assign one of your macros to the same key.
- The save/store option allows you to choose where you would like to
store the macro and key combination. If the macro is
document-specific, from the drop-down menu, choose
This Workbook. If you would like to save the macro and key in a new workbook, chooseNew Workbook. If you would like to save the macro to your permanent macro workbook, choosePersonal Macro Workbook. This will keep the macro and key combination active no matter what you are working on.
- Click
OK, and then create your macro as usual.
Assigning a shortcut to an existing macro
- In Excel 2010 and 2007, from the
Viewtab, clickMacros, and then selectView Macros.In Excel 2003 and earlier, from the
Toolsmenu, selectMacro, and thenMacros.... - A dialog box containing all macros in all open workbooks will
appear. Click the macro for which you would like to create a key
combination, and the name will appear in the field on top of the list.
- Click
Options.... A dialog box that contains information about the macro will open.
- In the "Shortcut Key:" field, enter the key you wish to assign in
conjunction with the
Ctrlkey (in Mac OS X,Option-Command) to trigger the macro. This can be any key, but you should check the key combination before assigning it to a macro. Excel has some predefined key combinations that you will erase if you assign one of your macros to the same key.
- Click
OKas needed to close any open dialog boxes.
This is document ahbm in domain all.
Last modified on May 27, 2010.
Last modified on May 27, 2010.







