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

Clean Up Your Macro List

by Allen Wyatt
(last updated May 9, 2017)

4

Whenever you use the macro recorder to record a macro, Excel assigns it a name of MacroN, where N is the next available macro number. Thus, your first macro recorded would be Macro1, the second would be Macro2, and so on. (Although Excel lets you pick a different name when you record the macro, it is my experience that most people do not take advantage of this for quick-and-dirty macros.)

Because of this naming practice, it is real easy to "muck up" your workbooks with macros you no longer need. Heck, you probably can't even remember what they do! The solution to this situation is to periodically clean out your macro list. I make it a habit to always delete anything that is in this default naming sequence. Doing this periodically means that your files take less space and your Excel workbooks take less time to load.

To delete a macro, just display the Macro dialog box (press Alt+F8), select the macro you want to delete, and then click the Delete button.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (8037) applies to Microsoft Excel 2007, 2010, and 2013. You can find a version of this tip for the older menu interface of Excel here: Clean Up Your Macro List.

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

Displaying a Single Page

When displaying the information in your document, Word is rather flexible. It can, if you so choose, display multiple ...

Discover More

Hyperlinks in Comments

Need to add a hyperlink to a comment? It's easy to do by following the steps outlined in this tip.

Discover More

Using a Numeric Portion of a Cell in a Formula

If you have a mixture of numbers and letters in a cell, you may be looking for a way to access and use the numeric portion of ...

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 (ribbon)

Creating a String in a Macro

Need to put together a bunch of characters to create a text string? You can do it in your macros by using the String ...

Discover More

Changing the Default Drive

Do you have a macro that need to read and write files? If so, then there is a good chance you need to specify the default ...

Discover More

Converting Phone Numbers

Sometimes you receive a phone number that contains alphabetic characters and you need to convert it to a purely numeric phone ...

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

2017-05-09 08:17:47

Kiwerry

If I'm not sure whether I want to delete a macro or not, I simply get into the Visual basic editor and give the macro an argument, so that for example
Macro1()
becomes
Macro1(a)
which has the effect that the macro no longer appears in the list, but it is easy to reactivate it or take a look at the code as necessary.


2014-07-07 01:01:34

Keith

I never4 use the macro1 naming method, but always use a meaningful name, unless its a one-off and i simply call it "AA". Doing the same next time wipes the old one which is always at the top of a long list.


2013-04-30 16:06:43

Aldo Santolla

"They also won't display in the list if they require arguments or are functions."

This is true, but you can manually enter the macro name with the arguments and assign them to controls. I do this with macros that have optional arguments where I can use the macro for several different types of calls and controls.


2013-04-29 08:25:19

Bryan

A better solution is to give your macros meaningful names in the first place...

Also, if you are properly modularizing your code (in other words, making repeated code portions their own subroutines/functions) you may have many of these "helper" modules in the module list. If they are only used as part of a larger module, make them private (Private Sub Whatever()) and they won't display in the list. They also won't display in the list if they require arguments or are functions.


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu 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.