O'Reilly logo

Microsoft Project 2007: The Missing Manual by Bonnie Biafore

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Recording Macros

The best way to get started with macros is to record one. You don't have to write any code or invoke any arcane VBA spells. You start the recorder, click the same menus, and press the same keys you always do, and then stop the recorder.

Recording a macro is like working a crossword puzzle in pen; you can't afford to make mistakes because they're indelibly saved along with what you got right. Before you record a macro, take some time to figure out what you want to record. Then, practice the steps a couple of times. Write up a cheat sheet if you're recording more than a few steps.

Working with macros is easier if you display the Visual Basic toolbar, which offers readily available buttons for the basic macro commands (Figure 27-1). Choose View → Toolbars → Visual Basic.

The first button on the Visual Basic toolbar (green right arrow) opens the Macros dialog box, which lists the available macros. The second button toggles between recording a macro and stopping recording. The Security command opens the Security dialog box so you can adjust the level of security if you're having trouble running macros. The last button opens the Visual Basic Editor for modifying your macro's code.

Figure 27-1. The first button on the Visual Basic toolbar (green right arrow) opens the Macros dialog box, which lists the available macros. The second button toggles between recording a macro and stopping recording. The Security command opens the Security dialog box so you can adjust the level of security if you're having trouble running macros. The last button opens the Visual Basic Editor for modifying your macro's code.

Next, make sure you perform any preliminary steps that you don't want to record in the macro—like opening a specific project or applying a view. In addition, the Project file must contain ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required