Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Renaming a Macro.

Renaming a Macro

Written by Allen Wyatt (last updated March 7, 2020)
This tip applies to Excel 97, 2000, 2002, and 2003


1

A macro is nothing more than a series of instructions you want the computer to execute. It is a program which is run in the context of the application you are using. As you create macros, you will probably come across a need to rename a few of the existing macros. To do this, follow these steps:

  1. Press Alt+F8 to display the Macros dialog box.
  2. From the list of macros displayed, select the one you want to rename.
  3. Click on Edit. The VBA Editor is displayed, with the code for the selected macro visible.
  4. At the top of the macro is the keyword "Sub" followed by the macro name, then a pair of parentheses.
  5. Change the macro name as desired, but leave "Sub" there, as well as the parentheses.
  6. Close the VBA Editor.

Remember that if you rename a macro, you may need to make other changes, as well. For instance, if you have the macro referenced (called) from a different macro, you'll need to change that other macro to reflect the name as you just changed it. If the macro is also referenced in toolbar buttons or in menus, you'll need to make changes in those to reflect the new name, as well.

Note:

If you would like to know how to use the macros described on this page (or on any other page on the ExcelTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2924) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Renaming a Macro.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Replacing Links with Values

Need to get rid of the links in your workbook but save the values that were retrieved by those links? It could be easy or ...

Discover More

Showing RGB Colors in a Cell

Excel allows you to specify the RGB (red, green, and blue) value for any color used in a cell. Here's a quick way to see ...

Discover More

Changing the Size of Start Screen Tiles

The Start screen can serve as your launching pad for whatever programs you use on your system. If your Start screen ...

Discover More

Professional Development Guidance! Four world-class developers offer start-to-finish guidance for building powerful, robust, and secure applications with Excel. The authors show how to consistently make the right design decisions and make the most of Excel's powerful features. Check out Professional Excel Development today!

More ExcelTips (menu)

Pulling Apart Cells

Separating text values in one cell into a group of other cells is a common need when dealing with text. Excel provides a ...

Discover More

Relative References when Recording Macros

When you record a macro, make sure that you know how Excel is recording your cell movements. This tip explains the ...

Discover More

Creating and Naming a Worksheet Using a Macro

You can use macros to make your common Excel tasks easier and faster. For instance, if you routinely need to create new ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 6 - 0?

2020-05-05 00:08:30

Rob

Hi,

Could you add a screenshot, please. Can't find where to change it in the interface/code.

Thanks.

Robert


This Site

Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.