accidently added a macro

leecavturbo

Well-known Member
Joined
Jan 4, 2008
Messages
681
how can i remove a macro from a worksheet/book?
i don't know anything about macros if that helps
thx
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
What is your macro, in other words, is it a module or some code in an Excel Event ? Can you post the code ?
 
Upvote 0
Right-click a worksheet tab, and choose View Code. This will open the VBEditor. At the top left, you should see the Project Explorer (looks a bit like Windows Explorer) with all the open workbooks listed. If you see a Modules section in your workbook, click the + symbol to expand it if necessary, then right-click each module and choose Remove Modulen (don't bother exporting unless you want to save the code). Once you have removed all the modules, close the VB Editor and save your workbook.
 
Upvote 0
here is what i have. there was a module in the at the bottom which i deleted
but when i open the workbook it still asks to enable marcos?
.
vba.jpg
 
Upvote 0
Did you check for code which may exist in the Workbook/Worksheet events ?

Edit: I am sorry, I am unable to view the picture you have posted due to office network restrictions.
 
Upvote 0
Delete the code you have displayed in that window (the Worksheet_SelectionChange event code) then resave the workbook.
 
Upvote 0
And check all the other modules too.:)
 
Upvote 0
ok deleted all that text and checked the other 6 sheets which show no code now.
but still asks to run macros when opened?
 
Upvote 0

Forum statistics

Threads
1,214,971
Messages
6,122,520
Members
449,088
Latest member
RandomExceller01

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top