Datasheet
Run a
Macro
M
acros enable you to perform quickly tasks that
would normally take multiple steps. When you
run a macro, Excel replays the steps you
recorded when you created the macro. You can run any
macro located in any workbook as long as the workbook
in which the macro is located is open. To run a macro,
you can press the shortcut key you assigned when you
created the macro or you can select the macro from the
Macro dialog box.
When you create a macro, you can choose to store it in
one of three locations: the current workbook, a new
workbook, or the Personal Macro Workbook. By default,
the Macro dialog box lists all of the macros in open
workbooks. If a macro is stored in the Personal Macro
Workbook, the workbook opens as a hidden file each
time you open a file. By default, the macros in the
Personal Macro Workbook always appear in the Macro
dialog box.
You can use the Macros In field to limit the number of
macros listed in the Macro dialog box. To see the macros
in any open workbook, including the Personal Macro
Workbook, select the All Open Workbooks option. To see
the macros from a specific workbook, select the name of
the workbook from the Macros In drop-down list. To see
global macros stored in the Personal Macro Workbook,
select the Personal.xlsb option.
To run a macro from another workbook, the macro must
be from a signed source or you must enable all macros.
You can set the security setting for macros. See the
section, “Set Macro Security,” for more information.
1 Select the cells to which you want to
apply your macro.
2 Click the Developer tab.
Note:
See the section, “Introducing
Macros,” to learn how to display
the Developer tab.
3 Click Macros in the Code group.
Alternatively, click Alt+F8.
1
2
3
4
Run a Macro
12
The Macro dialog box appears.
4 If your macro does not appear in the
Macro dialog box, click here and
then select the workbook that
contains your macro.
04_132302 ch01.qxp 7/27/07 9:20 PM Page 12