Datasheet

Chapter 1: Using Macros and Form Controls
13
Excel differentiates between macros listed in the
Macro dialog box by placing the name of the
workbook that contains the macros in front of the
macro name. For example, Excel lists a macro
named Sum_Expenses in the Personal Macro
Workbook as PERSONAL.XLSB!Sum_Expenses. If
the macro Sum_Cells exists in both the Budget.xlsm
and Expenses.xlsm workbooks, Excel treats them as
two different macros. The Macro dialog box lists
them as Budget.xlsm!Sum_Cells and
Expenses.xlsm!Sum_Cells.
If you have macro security enabled, the Trust Center
checks the macros when you open a workbook to
see if the macros are valid. If there are any
problems, Excel displays a warning just below the
Ribbon. You can click the Options button located
next to the warning to open the Microsoft Office
Security Options dialog box.
In the Microsoft Office Security Options dialog box,
click Help Protect Me from Unknown Content
(Recommended) to disable the macros, click Enable
the Content to enable the macros, or click Trust All
Documents from this Publisher to add the macro
publisher to the Trusted Publisher list. Excel does
not display a warning when you open workbooks
with macros if the publisher is on the Trusted
Publisher list.
5
6
Dollar_Money_Format
5 Click the name of the macro you want to run.
6 Click Run.
Excel runs the macro.
In this example, the macro adds dollar signs and
removes the decimal places.
You can also run your macro by pressing the
shortcut key you assigned when you created
your macro.
04_132302 ch01.qxp 7/27/07 9:20 PM Page 13