How to delete macros in excel
Tutor 5 (273 Reviews)
Excel Tutor
Still stuck with a Excel question
Ask this expertAnswer
A macro is an automated sequence of actions recorded or written in VBA that performs repeated tasks in Excel. To delete macros in Excel, remove them through the Macro dialog, the VBA editor, or by saving the file in a format that does not support macros.
Method 1: Delete macros through the Macro dialog
-
Open the workbook that contains the macros.
-
Select View on the Ribbon.
-
Select Macros.
-
Select View Macros.
-
Select the macro you want to delete.
-
Select Delete.
-
Save the workbook.
Windows and Mac use the same steps in this method.
Method 2: Delete macros through the VBA Editor
-
Press Alt + F11 on Windows or Fn + Alt + F11 on Mac to open the VBA editor.
-
Expand the Modules folder in the Project Explorer.
-
Select the module that contains the macro code.
-
Press Delete on the keyboard or right-click the module and select Remove Module.
-
Confirm the removal.
-
Close the VBA window and save the workbook.
Every standard macro created through the recorder sits inside a Module, and removing that module deletes every macro stored in it.
Method 3: Delete all macros by saving the workbook as a non-macro file
-
Select File.
-
Select Save As.
-
Select a location.
-
Select the Save as type dropdown.
-
Select Excel Workbook (*.xlsx).
-
Select Save.
The .xlsx format does not support macros, and Excel removes every macro embedded in the file. This action deletes macros in modules, worksheets, and workbook objects.
Method 4: Delete sheet-level or workbook-level VBA code
Macros sometimes sit inside sheet or workbook objects instead of modules.
-
Press Alt + F11 (Windows) or Fn + Alt + F11 (Mac).
-
In the Project Explorer, select ThisWorkbook or the required worksheet object.
-
Delete the code in the editor window.
-
Save the workbook.
Method 5: Remove assigned macro links from shapes or buttons
Deleting a macro does not remove the assigned triggers.
-
Select the shape or button.
-
Right-click and select Assign Macro.
-
Remove or change the assigned macro.
-
Select OK.
Why do deleted macros return
Deleted macros return when the macro exists inside hidden modules or personal macro workbooks.
How to remove macros from the Personal Macro Workbook
-
Open Excel.
-
Press Alt + F11 (Windows) or Fn + Alt + F11 (Mac).
-
Expand VBAProject (PERSONAL.XLSB).
-
Delete the modules or code.
-
Save and close.
Excel loads PERSONAL.XLSB every time Excel starts, so removing macros from it prevents them from reappearing.
How to confirm that macros are completely removed
-
Select File.
-
Select Info.
-
Check the Permissions or Inspect Workbook section.
-
Select Check for Issues.
-
Select Inspect Document.
-
Select Inspect.
-
Select Remove All next to the Macros category.
-
Save the workbook.
Document Inspector removes embedded macro remnants and confirms the workbook is macro-free.
When to use each deletion method
-
Use the Macro dialog for old recorded macros stored in modules.
-
Use the VBA editor for full module removal or advanced macros.
-
Use Save As (.xlsx) to clear every macro in one step.
-
Use Document Inspector for final verification.
-
Use Personal Macro Workbook removal when macros load unexpectedly.
Get Online Tutoring or Questions answered by Experts.
You can post a question for a tutor or set up a tutoring session
Answers · 1
How to sort by highlighted cells in excel
Answers · 1
How to sort excel by column and keep rows together
Answers · 1
How to sort by time in excel
Answers · 1
How to sort alphabetically in excel by last name
Answers · 1