Datasheet

Book IX
Chapter 1
Recording and
Using Macros
533
Figure 1-3:
The Macros
dialog box.
Editing a Macro
If you make a mistake while recording a macro, you can abandon the record-
ing and start over. Or, you can finish the recording and edit the macro to
correct the mistake. When you edit the macro, its commands appear in a
separate window. You can delete or modify erroneous commands, you can
insert new commands if you know how, or you can merely study the macro
to try to figure out how it works.
When you edit a macro, you’re exposed to Visual Basic for Applications (VBA).
VBA isn’t as deadly as the Ebola virus, but it can cause severe headaches and
nausea if you’re not inoculated with the Programmer Vaccine. For more infor-
mation about VBA and its editor, turn to Chapter 2 of this minibook.
Here are the steps for editing a macro:
1. Click the Macros button on the Developer tab on the Ribbon or on the
status bar.
The Macros dialog box appears. (Refer to Figure 1-3.)
2. Select the macro you want to edit and click the Edit button.
Word launches the Visual Basic editor, with the macro you selected vis-
ible in its own window. See Figure 1-4.
Notice that the Visual Basic editor uses good old-fashioned menus
instead of the newfangled Ribbon. Notice also that you may see addi-
tional macros other than the one you just recorded. For example,
besides the BoldItalic macro, Figure 1-4 also shows a macro named
StrikeThrough that was previously recorded.
Editing a Macro
50_487662-bk09ch01.indd 53350_487662-bk09ch01.indd 533 4/15/10 9:18 PM4/15/10 9:18 PM