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

Two Page Numbering Schemes in the Same Document

Word is great at numbering pages if you only need a single, consistent numbering scheme through the document. If you need two ...

Discover More

Edits Cause Text to Switch to Odd Fonts

If you have problems with strange fonts showing up when you paste information into a document, it is helpful to understand ...

Discover More

Detecting an Open Dialog Box

Macros can be used to perform all sorts of tasks within Word. Some tasks can even occur at whatever time interval you desire. ...

Discover More

Excel Smarts for Beginners! Featuring the friendly and trusted For Dummies style, this popular guide shows beginners how to get up and running with Excel while also helping more experienced users get comfortable with the newest features. Check out Excel 2013 For Dummies today!

More ExcelTips (ribbon)

Selecting a Range of Cells Relative to the Current Cell

When processing information in a macro, you often need to select different cells relative to the currently selected cells. ...

Discover More

Using Seek In a Macro

When reading information from a text file, your macro may need to start reading at a place other than the beginning of the ...

Discover More

Continuing Macro Lines

Sometimes a macro command line can get very, very long. This can make it hard to understand when you look at it a month or so ...

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. 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 9 + 4?

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.