Microsoft Office Tutorials and References
In Depth Information
Executing Sub Procedures
Enter a character into the Ctrl+ text box.
Note: The character that you enter into the Ctrl+ text box is case-sensitive. If you enter a
lowercase s, the shortcut key combo is Ctrl+S. If you enter an uppercase S, the shortcut
key combo is Ctrl+Shift+S.
Enter a description (optional). If you enter a description for a macro, it’s displayed at the
bottom of the Macro dialog box when the procedure is selected in the list box.
Click OK to close the Macro Options dialog box and then click Cancel to close the Macro
If you assign one of Excel’s predefined shortcut key combinations to a procedure, your
key assignment takes precedence over the predefined key assignment. For example,
Ctrl+S is the Excel predefined shortcut key for saving the active workbook. But if you
assign Ctrl+S to a procedure, pressing Ctrl+S no longer saves the active workbook.
The following keyboard keys are not used by Excel 2010 for Ctrl+key combinations: E,
J, M, and Q. Excel doesn’t use too many Ctrl+Shift+key combinations. In fact, you can
use any of them except F, L, N, O, P, and W.
Executing a procedure from the Ribbon
Excel’s Ribbon user interface was introduced in Excel 2007. In that version, customizing the
Ribbon required writing XML code to add a new button (or other control) to the Ribbon. Note
that you modify the Ribbon in this way outside of Excel, and you can’t do it using VBA.
Excel 2010 allows users to modify the Ribbon directly from Excel. It’s a simple matter
to add a new control to the Ribbon and assign a VBA macro to the control.
Refer to Chapter 22 for more information about customizing the Ribbon.
Executing a procedure from a customized shortcut menu
You can also execute a macro by clicking a menu item in a customized shortcut menu. A shortcut
menu appears when you right-click an object or range in Excel.
Refer to Chapter 23 for more information about customizing shortcut menus.