Macros in Excel

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How do you get rid of macros

I copied a worksheet in order to update it and now I have to disable macros every time I try to load it

Thanks
 
Go into the VBE, and select the code module, and remove it (File>Remove
module_name)

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

Still Learning said:
How do you get rid of macros?

I copied a worksheet in order to update it and now I have to disable
macros every time I try to load it.
 
You need to delete any empty modules that housed those macros.

Hit ALT+F11 and this will open the VBE (Visual Basic Editor)
Top left you will hopefully see an explorer style pane. Within this pane you
need to search for
your workbook's name, and when you find it you may need to click on the + to
expand it. Within
that you should see the following:-

VBAProject(Your_Filename)
Microsoft Excel Objects
Sheet1(Sheet1)
Sheet2(Sheet2)
Sheet3(Sheet3)
ThisWorkbook
Modules
Module1
Module2
etc etc (You may have just 1 of these)

If you have named your sheets then those names will appear in the brackets above
as opposed to
what you see at the moment in my note.

Right click on the modules and select remove. When prompted with a question re
exporting, just
hit no. Then hit File / Close and return to Microsoft Excel and save the file.
 
Still

You have some proposed solutions from others to remove modules. One thing
that wasn't mentioned was code in a worksheet(you did say you copied a
worksheet).

Right-click on the worksheet tab and "View Code". Delete anything you find in
there. May be as innocuous as "Option Explicit" or more.

Gord Dibben Excel MVP
 
Back
Top