Remove Macros From ExcelHere are ways to remove unnecessary macros from Excel

Written By:
Patrick Louie
Reviewed By:
FundsNet Staff

Did you know that Excel allows the use of macros?

If you want to automate repetitive tasks, macros are your friend (if you know how to code them).

But the thing about macros is that they increase the size of the Excel file.

This can cause the Excel file to run slower than usual.

So you might want to know how to remove macros from Excel should the need arise.

If you don’t plan to use macros at all, then you’d probably want to remove them. They just unnecessarily increase the file size after all.

Furthermore, you may want to only keep macros that you expect to use.

All other macros that you don’t need? Delete them!

It will make your macros list smaller and tidier.

And as a bonus, it keeps the file size small (which means faster loading times).

In this article, you’ll be learning how to remove macros from Excel.

Do you want to remove all macros from a certain workbook? I got you covered.

Do you only want to remove certain macros? I can teach you that as well.

So stay and read on to learn several ways of removing macros from Excel.

Save the Excel File in XLSX Format to Remove All Macros

If you want to remove all macros from a particular Excel workbook, the quickest way to do it is to save the workbook as an XLSX file.

This is because, by design, Excel files in the XLXS format cannot hold any macros.

This means that when you save a workbook in the XLXS format, any macros that it had will not be carried over.

For reference, only Excel files in the .XLSM, .XLSB, and other .XLS formats can hold macros.

Any other file formats (including XLSX files) will have no macros.

An added benefit to this is that you can create two versions of the same workbook: one with macros, and another without macros.

But you also have the option of deleting the original file (the one with macros) if you won’t need the macros in the future.

You can also save the two versions with the same name without overwriting one another (because of the different file formats).

Remove All Macros by Saving the Workbook in XLSX Format

  • Open the Excel file (typically an XLSM or XLSB file) that has the macros you want to remove.
  • Open the Save As dialog box by pressing the F12 key. Alternatively, you can access it via the File tab. Open the File tab. Then from the File menu, click on Save as. Then click on the Browse button (which has a folder icon).

  • Select the folder where you want to save your Excel file.

  • In the textbox after “File name”, enter the name of the new file.

  • Click the drop-down menu at the end of the textbox after “Save as type”.

  • From the menu, select Excel Workbook (typically the first option). This will save the file in XLSX format.

  • Click the Save button. Your workbook should now be saved as an XLSX file. Consequently, all macros in it will be removed.

To confirm that the workbook no longer has any macros in it, you can click the Macros button from the View tab.

Do note that by using this method, you will remove all macros from the workbook.

If you only want to remove certain macros, then this method is not suitable for you.

Fortunately, there are still other ways to remove macros from Excel.

Use the Macro Dialog Box to Remove Certain Macros From Excel

If you’re looking to delete only certain macros (not all of them), then you might want to use the Macro dialog box instead.

Just like the Save As XLSX, this method removes macros from the workbook that you’re currently working on.

However, you have more control over which macros you want to remove and which ones you want to keep.

Remove Macros by Using the Macro Dialog Box

  • Open the Macro dialog Box. There are three ways to do this. The quickest way is to press the keyboard shortcut Alt + F8. Another is to click the Macro button via the View tab.

  • Another way is to open the Developer tab. Then, click the Macros bottom (found on the left side).

  • In the Macro dialog box, you’ll see a list of macros that the workbook has. If you only want to delete one macro, you only need to click it. If you want to delete multiple macros, hold down the Ctrl key then click on the macros that you want to delete. Or if you want to delete all macros, click the first macro then, while holding the Shift key, click the last macro on the list. (For our illustration, we will only be deleting Macro1).

  • After selecting the macro(s) that you want to remove, press the Delete button.

  • A message will pop up asking you if you want to delete the selected macro(s). Click the Yes button to proceed.

  • Open the Macro dialog box again. You should find that the selected macro(s) have been removed.

Do note that you don’t see the macro(s) that you want to remove, it’s probably saved in another opened macro-enabled workbook.

To remedy this, you only have to click the dropdown menu at the end of the textbox after “Macros in”.

Then from the options, select “All Open Workbooks”.

This will display all the macros in all the currently opened workbooks.

Removing Hidden Macros

Macros that are saved in a Personal Macro Workbook will be hidden by default.

To remove them, you’ll have to unhide them first.

Use The Visual Basic Editor to Remove Macros From Excel

Last but not the least, you can remove macros from Excel using the visual basic editor.

You can access this feature by clicking the Visual Basic button via the Developer tab.

This is where you do the actual coding and macro development.

By using the Visual Basic Editor, you have the most control when it comes to removing macros from Excel.

With it, you can access all the macros (those in the worksheet, modules, or a personal macro workbook).

Remove Macros Using the Visual Basic Editor

  • Open the VBA window (a.k.a. Visual Basic Editor). This can be done in two ways. The quickest way is to press the keyboard shortcut Alt + F11. Another way is to click the Visual Basic button via the Developer tab.

  • In the VBA window, you should see the Project Explorer toolbox which will contain a list of all VBA projects, modules, and macros. If this toolbox is not appearing, you can make it appear by pressing the keyboard shortcut Ctrl + R. Alternatively, you may open the View tab and then click the Project Explorer option.

  • From the Project Explorer toolbar, select the module that contains the macros that you want to remove. Right-click on it. Click on the “Remove (module name)” option.

  • A message will pop up asking you if you want to export the module before removing it. Click the Yes button if you want to export it. Otherwise, click the No button.

  • The selected module as well as the macros it contains is now removed. Close the VBA window to go back to your Excel workbook.

You can confirm that the macros are removed if you open the Macro dialog box.

Conclusion

In this article, you’re able to learn the different ways to remove macros from Excel.

Whether you want to remove a certain macro or all of them, there’s a method that’s suitable for you.

I hope that you find this article helpful and easy to understand.