Excel: How To
Activate A Macro

by Lisanne Balcells-Baldwin


"I've made a macro!...now, how do I get it to run?"

In Excel 5.0 you have several choices on how to run your macro. Whichever one you choose is determined by the circumstances or by personal preference. The following is a brief summary of several ways it can be accomplished. Most of these methods can also be used (with a few modifications) in Excel 4.0.

1) Use the menu. Select TOOLS-MACRO and a list will pop up of all currently available macros. Click on the one you want, and then on RUN.

2) Create a toolbar button. You can either add a new button with an attached macro to an already existing toolbar, or make a new toolbar and put it there. For both routes go first to VIEW-TOOLBAR. To make a new toolbar, type in a new name in the box under Toolbar Name. Next, to Add A Button (to either an old or new toolbar) choose Customize.

Under Category, select Custom to bring up a selection of unassigned buttons. Click and drag one of them to a toolbar; a dialog box will then let you assign a macro to it. The Tool Tips for the button will say "Custom"; that can later be changed.

3) Make a shortcut key. This method is available when you create the macro, under Options. You can also go back and add a shortcut key to an already completed macro under TOOLS-MACRO: select the desired macro, and click Options.

4) Make a new menu item. You can either add your macro to an existing menu, or create an entirely new menu. It can be added to the TOOLS menu at the
same time as the shortcut key, as above. For a new menu or for a different menu location, use TOOLS-MENU EDITOR from a macro module.

Alternatively, you can call up the Menu Editor from a button on the Visual Basic toolbar. (Not available in Excel 4.0.)

5) Attach it to an object (such as a button) that you create on your spreadsheet. This method uses the Drawing tools, which have their own toolbar.

6) If you want your macro to run automatically, create an auto_open macro. If this macro is stored in PERSONAL.XLS in the XLSTART directory, it will run when Excel is started up.

If you save it in a workbook, then it runs when that workbook is opened. You can also create auto_close macros, to run whenever Excel or the workbook is closed.

7) Call it from within another macro. This way, one macro could be created that would be run with several other routines (macro)but it only has to written down once.

8) Use the Run Macro button on the Visual Basic toolbar, which will bring up the same panel as TOOLS-MACRO from the menu. (Not available in Excel 4.0.)

For more information about these options and other Excel goodies, be sure to attend the Microsoft Office/Excel SIG on the 3rd Friday of each month at 6:30 p.m.!

Lisanne Balcells-Baldwin is a HAL-PC member.


E-mail me at webmaster@hal-pc.org with any comments you have and tell me what you want to see here.

Back to the User Journal Home Page