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

Determining If a Number is Odd or Even

Need to know if a number in a macro is odd or even? It's easy to figure out with the simple calculation shown in this tip.

Discover More

Clearing the Contents of a Table

Want to get rid of information within a table, but not the table itself? Here's a guide to understanding the effects that ...

Discover More

Determining If a Date is between Other Dates

Need to figure out if one date is between two other dates? There are a wide variety of formulaic approaches you could use to ...

Discover More

Save Time and Supercharge Excel! Automate virtually any routine task and save yourself hours, days, maybe even weeks. Then, learn how to make Excel do things you thought were simply impossible! Mastering advanced Excel macros has never been easier. Check out Excel 2010 VBA and Macros today!

More ExcelTips (ribbon)

Reorganizing Data

If you need to consolidate a single column of data into multiple columns of data, you'll love this macro. It provides a way ...

Discover More

Selecting a Cell in the Current Row

Macros often need to select different cells in a worksheet. Here's how you can use macro commands to change which cell is ...

Discover More

Magnifying Only the Current Cell

You can use the Zoom feature of Excel to magnify what Excel shows of your workbook, but it affects the entire screen. What if ...

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 nine more than 8?

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.