Running a Macro

When you record a macro, its name is added to the list of macros you have recorded. If you assigned a shortcut keystroke to the macro, the easiest way to run the macro is to press the keystroke. If you did not assign a keystroke to the macro, you must select the macro from a list, as explained in the following steps:

  1. Open the Tools menu, point to Macro , and choose Macros (or press Alt+F8 ). A list of available macros appears, as shown in Figure 13.3.

    Figure 13.3. You can select the macro you want to run from a list of recorded macros.

    graphics/13fig03.gif

  2. Click the name of the macro you want to run.

  3. Click the Run button.

Caution

graphics/cman.gif

Before running your macro for the first time, save your workbook. If the macro performs some actions that you do not approve, close the workbook without saving the changes. If, however, the macro includes a File, Save command, you might be out of luck. To stop a macro before it does too much damage, press Ctrl+Break to stop the macro, and then use the Undo feature to try to recover from any damage the macro has caused.


Although selecting a macro from a comprehensive macro list is a foolproof way to find and play the macro, it is hardly the most efficient. If you find yourself frequently playing back the macro, consider assigning a shortcut keystroke to the macro. To assign a keystroke to an existing macro, follow these steps:

  1. Open the Tools menu, point to Macro , and choose Macros (or press Alt+F8 ). A list of available macros appears, as you saw in Figure 13.3.

  2. Click the name of the macro to which you want to assign a keystroke.

  3. Click the Options button. The Macro Options dialog box appears, as shown in Figure 13.4.

    Figure 13.4. Enter your preferences in the Macro Options dialog box.

    graphics/13fig04.gif

  4. Click in the Shortcut key: Ctrl+ box and hold down the Shift key while pressing the letter key you want to use in combination with the Ctrl key to launch your macro. By doing so, you assign the macro a Ctrl+Shift+ letter key shortcut.

  5. Click the OK button to close the Macro Options dialog box and return to the Macro dialog box.

  6. Click the Macro dialog box's Close button. You can now use the shortcut keystroke you assigned to your macro to run it.

Another way to run a macro is to create a toolbar button for it, as explained in the following section.



Absolute Beginner's Guide to Microsoft Office Excel 2003
Absolute Beginners Guide to Microsoft Office Excel 2003
ISBN: 0789729415
EAN: 2147483647
Year: 2002
Pages: 189

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net