Removing VBA Macros is easier if you know the right methods. In this article, I’ll show you how 5 suitable ways to remove Macros from a file in Excel. You’ll learn both to delete the Macros one by one and to eradicate all the Macros together from our Excel worksheets. Before jumping into the methods in the next section, take a look at the overview of this article.
Download Practice Workbook
5 Easy Ways to Remove Macros from Excel
Here we’ve got an Excel workbook with 5 Macros, namely Macro_1, Macro_2, Macro_3, Macro_4, and Macro_5 respectively. Today our objective is to remove the Macros from this workbook.
1. Select and Remove Macros from the Macro Dialogue Box in Excel
You can remove the Macros from your workbook by selecting them from the dialogue box called Macro.
â§ Step 1: Opening the Macros Dialogue Box
➤ Go to the Macros tool under the section called Code from the Developer tab in your Excel Toolbar.
➤ Click on Macros.
⧪ Note: The Developer tab is by default a hidden tab in Excel. So click here to see how to open the Developer tab in case you don’t find it.
â§ Step 2: Deleting the Desired Macro
➤ A dialogue box called Macro will open.
➤ Select the Macro you want to delete, and then click on Delete from the right panel.
Here, I am going to delete Macro_5.
You’ll find your desired Macro deleted from your workbook.
♦ Things to Remember:
- This is the most useful method to remove the Macros, as you needn’t remove all the Macros in this method.
- You can remove the Macros that you don’t want, and keep the rest that you need. So it’s quite handy.
2. Use Shortcut Key to Delete Macros from the Macro Dialogue Box in Excel
There is also a shortcut key to remove the Macros from the Macro dialogue box.
â§ Step 1: Pressing Shortcut Key to Open the Macro Dialogue Box
➤ Press ALT+F8 on your keyboard.
➤ The Macro Dialogue box will open.
â§ Step 2: Deleting the Desired Macro
➤ Then follow the step mentioned in Method 1.
➤ Select the Macro you want to delete, and then click on Delete from the right panel.
Here, I am again going to delete Macro_5.
You’ll find the selected Macro deleted from your workbook.
♦ Things to Remember:
- This is also one of the easiest methods to delete your desired Macro.
- But you must remain in any of your worksheets while pressing the shortcut key. Otherwise, it won’t work.
Similar Readings:
- How to Remove Formulas in Excel: 7 Easy Ways
- Remove Strikethrough in Excel (3 Ways)
- How to Remove Numbers from a Cell in Excel (7 Effective Ways)
3. Select and Erase Macros from the Modules in Excel
You can use this method if the Macros are created by inserting Modules in your workbook.
â§ Step 1: Opening the VBA Window
➤ Go to the Visual Basic tool under the section Code from the Developer tab in your Excel Toolbar.
➤ Click on Visual Basic.
â§ Step 2: Selecting the Module with the Macro
➤ The VBA window will open.
➤ Select the Module that contains the Macro you want to delete from the right scroll bar under the section Modules.
Here I’ve selected Module 5.
â§ Step 3: Removing the Module by Right-Click
➤ After selecting the desired module, right-click on your mouse.
➤ From the options available, click on Remove Module.
â§ Step 4: Checking the Warning Box
➤ You’ll find a warning box asking you whether you want to export the module before removing it or not.
➤ Click on No.
You’ll find the selected module removed from the workbook.
♦ Things to Remember:
- This method is also useful, but the only limitation is that the selected module will be deleted permanently in this method.
- That means, if you delete Module5, it will be deleted permanently. Later on, If you open a new module, it will be named Module6, not Module5.
- In order to avoid this issue, select Yes in step 4. Then you’ll be asked to save a Basic file (*.bas) similar to the name of the module (Module5 here). Save it.
4. Run Shortcut Key to Remove Macros from the Modules in Excel
There is also a shortcut key to open the VBA window and delete the desired modules.
Press ALT+F11 on your keyboard. The VBA window will open.
Then follow the steps described in Method 3. Select your desired module, right-click it, and then remove the module.
The desired module will be removed from your workbook.
5. Delete All the Macros Together by Saving it as an xlsx File in Excel
If you want to delete all the Macros together, use this method.
â§ Step 1: Opening the File Tab
➤ Click on the File tab on the rightmost side of the Excel Toolbar.
â§ Step 2: Saving the Workbook as Excel Workbook
➤ Save the Workbook as Excel Workbook instead of Excel Macro-Enabled Workbook.
- You’ll find all the Macros removed automatically from your workbook.
Conclusion
Using these methods, you can remove the Macros from your workbook, either one by one or by all the Macros together. Do you have any questions? Feel free to ask us on our Exceldemy website.