As I write this, Halloween is right around the corner, and I’ve got two scary words to put you in the mood:
Are you scrambling for you virus scanners? You’ve watched the news and know what big havoc these small programs can wreak with your computer. But here’s the kicker: macros were intended to be–and are–big energy and time savers. Prove this for yourself by trying out a simple macro.
The problem our macro will solve is to apply several kinds of formatting to a selection, and do so with a single key stroke. Here’s what we’re going for:
You might not ever need to use such formatting. But, if you did, a macro could make short work of the job.
Let’s record our macro.
Inside Word, type some text and select it. Select Developer>Record Macro. (If you don’t see the Developer tab, unhide it by selecting the colorful MS Office icon in the upper left corner of Word, choosing “Word Options” and then checking the “Show Developer Tab in the Ribbon” option.)
Enter “myMacro” for the macro name, then click the Keyboard button. In the “Press new shortcut key” field, press Alt-O, then click Assign, and then Close. Word starts recording your actions. Apply all the formatting you want: bold, italic, double underline, wavy borders, fonts from Mars, the kitchen sink, you name it.
Figure 1: Recording the Macro
Figure 2: Assigning the Shortcut Key
Once your formatting binge feels fully sated, do these extra tasks on the text you selected: select Insert>Bookmark, enter “gaga” for the bookmark name, and click Add. Then press the left arrow key to go to the start of the selection. Select Insert>Symbol, pick out something frilly like a heart, and click Insert.
Figure 3: Inserting a Bookmark and Inserting a Symbol
Go to the bookmark you just made: Select Insert>Bookmark, choose “gaga,” and click Go To. Press the right arrow key this time, and insert another frilly symbol just as you did on the left of the selection.
You’re doing a lot of formatting work here, but don’t tire out until you see your macro in action. Select Developer>Stop Recording. Then, pause for a moment and think about how long it took you to apply all that formatting. Imagine having to apply that formatting again and again and how long it would take to do it. You could do some of it with a custom style, but not the frilly symbols part. Even if you could, you’d miss out on: A.The fun of using macros and B. The power of macros to do what custom styles can’t do: namely, everything that Word can do.
It’s time to replay your macro. Select some unformatted text and press Alt-O, the keystroke you assigned the macro to when you began recording it. Ta-dah: instant formatting!
The next time you find yourself doing the same Word task over and over, try recording a macro for it. Macros aren’t malware, they’re just infectious.