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

Using Custom Number Formats

Most formatting needs are met by using the predefined formatting options in Excel. The program also allows you to move beyond ...

Discover More

Saving Changes when Closing

If your macro closes workbooks, you'll want to make sure that it will save any changes you made to the workbook. Here's how ...

Discover More

Cleaning Old Cookie Sheets

Sometimes baked-on stains can be very stubborn to remove from metal cookware. Here are some ideas that may help get rid of ...

Discover More

Solve Real Business Problems Master business modeling and analysis techniques with Excel and transform data into bottom-line results. This hands-on, scenario-focused guide shows you how to use the latest Excel tools to integrate data from multiple tables. Check out Microsoft Excel 2013 Data Analysis and Business Modeling today!

More ExcelTips (ribbon)

Automating the Importing of Macros

Macros are great when it comes to automating how you work with your workbooks. What if you want to fundamentally change the ...

Discover More

Highlighting Pattern Violations

A common part of working with text strings in a worksheet is normalizing those strings so that they follow whatever rules ...

Discover More

Finding Other Instances of Excel in a Macro

When processing information using a macro, you may need to know if there are any other instances of Excel running on a ...

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 one more than 9?

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.