How to Add an Excel 2007 Macro to the Quick Access Toolbar
How to Set the Macro Security Level in Excel 2007
Excel 2007 VBA Programming Functions

How to Run an Excel 2007 Macro

After you record a macro in Excel 2007, either by using the macro recorder or by creating it in Visual Basic for Applications (VBA), you run the macro to have it carry out the commands and keystrokes that are saved as part of the macro.

The macro commands in Excel 2007 are located on the Developer tab, which doesn’t appear on the Ribbon by default. To display this tab, click the Office button and then click Excel Options. Select the Show Developer Tab in the Ribbon check box (on the Popular tab) and click OK.

Follow these steps to run an existing macro in Excel 2007:

  1. Click the Macros button in the Code group of the Developer tab.

    The Macro dialog box appears. Excel lists the names of all the macros in the current workbook and in your Personal Macro Workbook (provided you’ve created one) in the Macro Name list box.

  2. Click the name of the macro in the list box and click the Run button.

    Selecting the macro to run in the Macro dialog box.
    Selecting the macro to run in the Macro dialog box.

If you assigned a shortcut keystroke to the macro, you don’t have to open the Macro dialog box to play the macro: Simply press the shortcut keys that you assigned and Excel immediately plays back all of the commands that you recorded.

If you run your macro in a worksheet that already contains data in the cells that the macro uses, you run the risk of having existing data and/or formatting overwritten during the macro’s execution. Keep in mind that, although you can use the Undo feature to reverse the very last action performed by your macro, most macros perform a series of actions, so you may end up using multiple levels of Undo before you are able to successfully reconstruct your spreadsheet.

If you no longer need a macro that you’ve created or want to scrap one and start over again, you can easily delete the macro. Click the Macros button in the Code group of the Developer tab, select the macro you want to remove in the Macro dialog box, and click the Delete button.

  • Add a Comment
  • Print
  • Share
blog comments powered by Disqus
Saving and Using an Excel 2007 Macro-Enabled Workbook
How to Automate Tasks with Macros in Excel 2007