Microsoft Office Tutorials and References
In Depth Information
Recording Your First Macro
Figure 13-1: Enabling the Developer tab.
When you see the Developer tab on the Ribbon, you can select it and click the Record Macro
command. This opens the Record Macro dialog box, as shown in Figure 13-2.
Figure 13-2: The Record Macro dialog box.
Here are the four fields in the Record Macro dialog box:
➤ Macro Name: Excel gives a default name to your macro, such as Macro1, but it’s best practice
to give your macro a name more descriptive of what it actually does. For example, you might
name a macro that formats a generic table as AddDataBars.
➤ Shortcut Key: (Optional) Every macro needs an event , or something to happen, in order for it
to run. This event can be a button press; a workbook opening; or, in this case, a keystroke
combination. When you assign a shortcut key to your macro, entering that combination of
keys triggers the macro to run. You don’t need to enter a shortcut key to run the macro.
➤ Store Macro In: This Workbook is the default option. Storing your macro in This Workbook
simply means that the macro is stored along with the active Excel file. The next time you
open that particular workbook, the macro will be available. Similarly, if you send the
workbook to another user, that user can run the macro as well (provided the macro security is
properly set by your user — but more on that later).
➤ Description: (Optional) Useful if you have numerous macros in a spreadsheet or if you need
to give a user a detailed description about what the macro does.