Please Note: This article is written for users of the following Microsoft Word versions: 2007, 2010, and 2013. If you are using an earlier version (Word 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Word, click here: Renaming a Macro.

Renaming a Macro

by Allen Wyatt
(last updated January 9, 2017)

4

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 it's easiest to work with the VBA Editor. Follow these steps:

  1. Press Alt+F8. Word displays the Macros dialog box.
  2. In the list of available macros, choose the one you want to rename. The Edit button should become active.
  3. Click Edit. The VBA Editor is started, and you see the macro you chose to edit.
  4. At the top of the macro you'll see the procedure definition, consisting of the word "Sub" followed by the name of the macro. Change the actual name in this line. (Don't change the word Sub or the space that follows the word Sub, and don't change anything starting with the left parenthesis that follows the name of the macro.)
  5. Close the VBA Editor.

That's it; the macro is now renamed to whatever name you used in step 4.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (7915) applies to Microsoft Word 2007, 2010, and 2013. You can find a version of this tip for the older menu interface of Word 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

Updating an Entire TOC from a Macro

The TOC (Table of Contents) is generated by a field. This field may be updated in a macro using a single command line.

Discover More

Finding an Invisible Text Box

Text boxes can be a great aid in designing the layout of your document. What do you do when you can't find a text box that ...

Discover More

Merging and Printing a Series of Documents

Do you need to merge and print a number of documents in a particular order? Perhaps the best approach is to record a simple ...

Discover More

The First and Last Word on Word! Bestselling For Dummies author Dan Gookin puts his usual fun and friendly candor back to work to show you how to navigate Word 2013. Spend more time working and less time trying to figure it all out! Check out Word 2013 For Dummies today!

More WordTips (ribbon)

Setting the Left Indent of a Paragraph in a Macro

When using a macro to format text, you can set all sorts of attributes for paragraphs or individual characters. On attribute ...

Discover More

Converting Strings to Numbers

When creating macros, you often need to convert a text string that contains numbers into actual numeric values. You do this ...

Discover More

Controlling the Italic Text Attribute

If you are formatting your document by using a macro, you may need to make some of your text italics. You do that by changing ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, 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}] 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?

2017-01-09 16:14:44

allen@sharonparq.com

Phil: No, unfortunately it doesn't. You'll need to handle that part manually.

-Allen


2017-01-09 15:01:10

Phil Maier

Thanks for this tip Allen. When renaming a macro this way does the VBA editor also change all references to the macro where it is invoked in the code modules for the application?


2017-01-09 11:39:42

mandora

If there are calls to the original macro, change those names as well.


2014-04-08 17:13:00

ravi

Sub: MS Word (office 2010), TIP NOT WORKING

1. This tip does not work "in MY" ms_word 2010.
2. After renaming, macro does not work.
3. EVEN AFTER RE-RENAMING TO ORIGINAL NAME, macro does not respond/work!

Please Guide,
-Regards


This Site

Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, 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.