Page 181 - Excel Data Analysis
P. 181

10 537547 Ch09.qxd  3/4/03  12:13 PM  Page 167






                                                                  AUTOMATING ACTIONS WITH MACROS 9




                                                You can use the Macros In field to limit the number of macros
                                                that are displayed in the Macro dialog box. To see the macros
                                                in any open workbook, including the Personal Macro
                                                Workbook, you can select the All Open Workbooks option. If
                                                you want to see only the macros from a specific workbook,
                                                select the name of the workbook in the Macros In drop-
                                                down list. For the global macros stored in the Personal Macro
                                                Workbook, you need to select the PERSONAL.XLS option.
                                                Excel differentiates between macros listed in the Macro dialog
                                                box by placing the name of the workbook that contains the
                                                macro in front of the macro name. For example, Excel lists a
                                                macro named Sum_Expenses in the Personal Macro
                                                Workbook as PERSONAL.XLS!Sum_Expenses. Because of
                                                this naming scheme, two workbooks can have macros with
                                                the same name. In other words, if the macro Sum_Cells
                                                exists in both the Budget.xls and Expenses.xls
                                                workbooks, Excel treats them as two different macros
                                                because they are stored in two different locations. The Macro
                                                dialog box lists the macros as Budget.xls!Sum_Cells and
                                                Expenses.xls!Sum_Cells.












                                                                               Calculate_Total
                                                                               Calculate_Total















                     ■ The selected workbook   ˇ Click Tools ➪ Macro ➪   ■ If the macro is not listed,   ■ The selected macro
                     opens.                   Macros.                   you can select the location of   executes and makes the
                                                                        the macro.                appropriate changes to the
                     › Click the cell in which   ■ The Macro dialog box                           worksheet.
                     you want the macro to    opens and displays a list of   Á Click the macro that you
                     execute.                 available macros.         want to run.              ■ To run the macro again,
                                                                                                  repeat steps 4 through 7.
                                                                        ‡ Click Run.
                                                                                                                     167
   176   177   178   179   180   181   182   183   184   185   186