Microsoft Office Tutorials and References
In Depth Information
Assign a Shortcut Key to a Macro
Chapter 11: Learning VBA Basics
The Macro Options dialog
7 Type the character you
want to use as part of the
8 Click OK.
Excel assigns the shortcut
key to the macro.
9 Click Cancel.
You can now run the
macro by pressing the
Do not specify a shortcut key that conflicts
with the built-in Excel shortcuts — such as
Ctrl+B for bold formatting or Ctrl+C for
copying text. If you use a key that clashes
with an Excel shortcut, Excel overrides its
own shortcut and runs your macro instead,
provided that the macro workbook is open.
Remember, too, that your macro shortcut
keys apply only to your copy of Excel. If
you share the workbook with another user,
that person does not have access to your
Did You Know?
Only five letters are not assigned to Excel
commands that you can use with your
macros: e, j, m, q, and t. You can create
extra shortcut keys by using uppercase
letters. For example, if you type e into the
Ctrl+ text box of the Macro Options dialog
box, you press Ctrl+E to run the macro.
However, if you type E into the Ctrl+ text
box, you press Ctrl+Shift+E to run the
macro. Note that Excel uses four built-in
Ctrl+Shift shortcuts: A, F, O, and P.