Datasheet

Book VIII
Chapter 1
Building and
Running Macros
Macro Basics
703
When you create a macro with the macro recorder, you decide not only the
workbook in which to store the macro but also what name and shortcut key-
strokes to assign to the macro that you are creating. When assigning a name
for your macro, use the same guidelines that you use when you assign a stan-
dard range name to a cell range in your worksheet. When assigning a shortcut
keystroke to run the macro, you can assign
The Ctrl key plus a letter from A to Z, as in Ctrl+Q
Ctrl+Shift and a letter from A to Z, as in Ctrl+Shift+Q
You can’t, however, assign the Ctrl key plus a punctuation or number key
(such as Ctrl+1 or Ctrl+/) to your macro.
The Status bar at the bottom of the Excel 2007 program window contains a
Record Macro button (the red dot on a worksheet to the immediate right of
the Ready status indicator) that you can click to turn on the macro recorder.
In addition, the Ribbon’s View tab contains a Macros command button to
which a drop-down menu containing the following three options is attached:
View Macros: Opens the Macro dialog box where you can select a macro
to run or edit.
Record Macro: Opens the Record Macro dialog box where you define
the settings for your new macro and then start the macro recorder the
same as clicking the Record Macro button on the Status bar.
Use Relative References: Uses relative cell addresses when recording
a macro, making the macro more versatile by enabling you to run it in
areas of a worksheet other than the ones originally used in the macro’s
recording.
And if this is not enough, Excel 2007 enables you to add a Developer tab to
the Ribbon.
To add the Developer tab to the Excel 2007 Ribbon, follow these two steps:
1. Click Office Button | Excel Options or press Alt+FI to open the Excel
Options dialog box.
2. Click the Show Developer tab in the Ribbon check box on the Popular
tab to select it and then click OK.
When you turn on the macro recorder either by clicking the Record Macro
button on the Status bar, clicking the Record Macro option on the Macros
command button on the View tab (Alt+WMR), or clicking the Record Macro
36_037385 bk08ch01.qxp 11/27/06 1:35 PM Page 703