Creating shortcut keys

The final user interface option at your disposal is to create custom shortcut keys. If speed is essential, pressing a key combination is usually faster than issuing menu commands, using a toolbar, or working with a dialog box. Excel lets you assign a Ctrl key (or Shift+Ctrl key) combination (shortcut) to a macro. When the user presses the key combination, the macro executes.

Be cognizant, however, of these two caveats. One, obviously, you have to make it clear to the user which keys are active and what they do. Second, you need to be careful not to assign a key combination that's already in use for something else. In other words, a key combination that you assign to a macro takes precedence over the built-in shortcut keys. For example, Ctrl+S is a built-in Excel (and standard Microsoft) shortcut key used to save the current file. If you assign this key combination to a macro, you lose the ability to save the file with Ctrl+S. Remember: Shortcut keys are case-sensitive, so you can use a combination such as Ctrl+Shift+S.

Part III of this book is devoted to VBA, which is the language that you'll use to write your macros.

0 0

Post a comment