
Tips.Net > ExcelTips Home > Macros > Editing Macros
Summary: If you start using macros to process data in Excel, you’ll eventually have to edit those macros. You can also display macros developed by other people (or created with the Macro Recorder) to see how particular actions are performed in the VBA code. This tip shows just how easy it is to display and edit a macro. (This tip works with Microsoft Excel 97, Excel 2000, Excel 2002, and Excel 2003.)
Taking a look at the programming code used in a macro (either ones you have recorded or macros created by others) is a great way to help you understand how the macro is put together and how it works. You can do this examination, and make changes to your macros, by editing them. This is done by first choosing the Macro option from the Tools menu. When you do, you will see a submenu from which you should select the Macros option. Excel displays the Macro dialog box. (Click here to see a related figure.)
In the list of available macros you should choose the macro you want to edit. When you have selected one, you can click on the Edit button, and the VBA Editor is displayed, with the selected macro loaded and ready to edit.
Once your macro is displayed, you can make changes to it as desired. You use many of the same editing functions you use when making changes to a regular worksheet. Unless you fully understand the consequences of your changes, it is typically best to stick to recording simple macros. If you feel adventurous, however, there is nothing wrong with making changes to your macros to see what they will do. If you do so, it is a good idea to keep these tips in mind:
If you keep these tips in mind, there is very little chance that you will hurt anything. In fact, your chances of learning more about Excel and macro programming are much greater than the risk of damaging any data. Give it a try!
When you have finished making changes to your macro, you should close the VBA Editor. Closing the VBA Editor is done in the same manner as when you close any other Windows program--simply double-click on the Close icon in the upper-right corner of the window.
Tip #2331 applies to Microsoft Excel versions: 97 2000 2002 2003
Save Time! You can have this tip (and several hundred just like it) in the ExcelTips annual archives. Imagine having over 400 tips available at your fingertips, in each annual volume.
Add power to your purpose with Excel. A comprehensive 500+ page e-book explains everything you need to know about macros. (more information...)
Ask an Excel Question
Make a Comment
ExcelTips FAQ
ExcelTips Premium
Beauty Tips
Bugs and Pests Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Money Tips
Organizing Tips
Pet Tips
Word2007 Tips
WordTips
Advertise on the
ExcelTips Site