O'Reilly logo

Microsoft® Office Excel 2003 Inside Out by Mark Dodge, Craig Stinson

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

Adding Code to an Existing Macro

Suppose you've recorded a macro that enters a series of labels, sets their font, and then draws a border around them. Then you discover that you forgot a step or that you recorded a step incorrectly—you chose the wrong border format, for example. What do you do?

To add code to an existing macro, you can record actions in a temporary macro and then transfer the code into the macro you want to change. For example, to add to the CompanyAddress macro a step that sets font options for the company's name, follow these steps:

  1. Switch to the worksheet that contains the address you entered earlier and select cell A6, which contains the name of the company.

  2. Choose Tools, Macro, Record New Macro. Excel presents the Record Macro ...

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