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 ...

Get Microsoft® Office Excel 2003 Inside Out now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.