When a macro is created, Excel adds a module to the workbook to store the macro. When you delete all the macros in the workbook the module does not get deleted.
Note: A macro is a recording of a set of commands. Once a macro is recorded you can simply type the macro's name instead of typing the complicated sequence of commands, and all the commands automatically run that you have recorded.
How to delete the Module:
- Open the Excel file that no longer contains the macro.
- Press Alt+F11 (function key at top of keyboard) to display the Visual Basic Editor.
- Near the upper-left side of the editor is the Project Explorer. This contains a hierarchical tree that shows the workbook name and the different modules in your workbook. If the Project Explorer is not visible on your screen, press Ctrl+R to display it.
- Within the Project Explorer should be a folder called Modules. If it is not already open, double-click on the Modules folder to display its contents.
- Right-click on a module in the folder. A menu is displayed. (See picture below.)
- Choose the Remove option from the menu. You are asked if you want to export the module before removing it.
- Click on the No button. The module is removed.
- Repeat steps 5 through 7 for each module in the Modules folder under your workbook name.
- Close the Visual Basic Editor.
- Save your workbook.