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

by Allen Wyatt
(last updated August 3, 2017)


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.

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


Summing Digits in a Value

Want to add up all the digits in a given value? It's a bit trickier than it may at first seem.

Discover More

Changing How Changes are Noted in Word

Do you want to modify how Word marks changes in your document? It's easy to do, if you know where to look.

Discover More

Displaying a Calendar

Want to know what today is? How about the date for next Thursday or the second Friday in October? Windows can display a ...

Discover More

Save Time and Supercharge Excel! Automate virtually any routine task and save yourself hours, days, maybe even weeks. Then, learn how to make Excel do things you thought were simply impossible! Mastering advanced Excel macros has never been easier. Check out Excel 2010 VBA and Macros today!

More ExcelTips (menu)

Deriving an Absolute Value in a Macro

Need to figure out an absolute value within your macro code? It's easy to do using the Abs function, described in this tip.

Discover More

Creating Worksheets with a Macro

Using a macro to add worksheets to your workbook is easy. This tip provides two different methods you can use.

Discover More

Engineering Calculations

Need to normalize your data in some way so that all your values are in a given format? This tip presents a number of ...

Discover More

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

View most recent newsletter.


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}] 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 4 + 4?

2018-02-27 13:06:29

Terry Kepner

On my version of MS Word 2013 I have two macros, Swap_Letter and Word_Count. They work perfectly. However, the names that appear on the HOME bar in "New Group" are "Normal.NewMacros.Swap_Letter" and "Normal.NewMacros.Word_Count" How do I get rid of the "Normal.NewMacros." so that only Swap_Letter and Word_Count are displayed on the screen as the macros' names?

2017-01-26 16:02:03

Joe Maier

Module C1_test1 exists
I tried to create ne module named C1_test2
Get error msg not allowing the creation

2017-01-09 12:17:21


Re: After renaming a module, shortcuts do not work... answer to this problem...

>>>It looks like you gave your module the same name as the macro. If you did then that is the problem. This will confuse the VBA compiler. I will use underscores in my module names (spaces are not allowed) so I know what the macro is but not confuse VBA.

For example, I would name the module CGM_Formatting_WIRELINE and the macro name would be CGMFormattingWIRELINE. Change the name, resave the file, and you should be okay.<<<

This solved my problem(S) that have been going on for a long time and I could not find the answer!

2015-06-08 12:15:07


I changed the name of a macro, now I can not find it! Any help would be great!

2015-05-07 12:02:50


I rename the module from module 1 to a different name, but now the shortcut keys that was assigned to module 1 is not working, and when I view the list of macros this macro name has had the file name added to it plus the macro name has been added again. Example: FileName.MacroName.MacroName instead of just MacroName. Does anyone have any suggestions on how to fix this problem?

2015-04-15 08:13:59


I like it, it helps.
Thanks... :)

2014-08-27 05:56:09

Willy Vanhaelen

Simply reassign the shortcut.

2014-08-26 17:23:07


I am having the similar issue
I rename the module from module 1 to a different name, but now the shortcut that was assisgnged to module 1 is not working, how to I fix it
Any suggesstions

2014-04-08 03:27:18

Andy Y

Thanks for the tip! Very helpful.

2013-08-13 03:08:11


Glad with your tip it is so easy

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

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.