Loading
Excel.Tips.Net ExcelTips (Menu Interface)

Renaming a Macro

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.

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.

Related Tips:

Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!

 

Leave your own comment:

*Name:
Email:
  Notify me about new comments ONLY FOR THIS TIP
Notify me about new comments ANYWHERE ON THIS SITE
Hide my email address
*Text:
*What is 5+3 (To prevent automated submissions and spam.)
 
 
           Commenting Terms

Comments for this tip:

David    08 Jun 2015, 12:15
I changed the name of a macro, now I can not find it! Any help would be great!
Larry    07 May 2015, 12:02
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?
Naser    15 Apr 2015, 08:13
I like it, it helps.
Thanks... :)
Willy Vanhaelen    27 Aug 2014, 05:56
Simply reassign the shortcut.
Shahid    26 Aug 2014, 17:23
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
Andy Y    08 Apr 2014, 03:27
Thanks for the tip! Very helpful.
Premchandar    13 Aug 2013, 03:08
Glad with your tip it is so easy
Thanks
Prem
 
 

Our Company

Sharon Parq Associates, Inc.

About Tips.Net

Contact Us

 

Advertise with Us

Our Privacy Policy

Our Sites

Tips.Net

Beauty and Style

Cars

Cleaning

Cooking

DriveTips (Google Drive)

ExcelTips (Excel 97–2003)

ExcelTips (Excel 2007–2016)

Gardening

Health

Home Improvement

Money and Finances

Organizing

Pests and Bugs

Pets and Animals

WindowsTips (Microsoft Windows)

WordTips (Word 97–2003)

WordTips (Word 2007–2016)

Our Products

Helpful E-books

Newsletter Archives

 

Excel Products

Word Products

Our Authors

Author Index

Write for Tips.Net

Copyright © 2016 Sharon Parq Associates, Inc.