STOP that macro!

Tarver

Board Regular
Joined
Nov 15, 2012
Messages
109
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
I've got some macros in a sheet that run automatically when a change happens.

How can I stop that code from executing temporarily while I work in and update my sheet? Such a simple question and I should know the answer, but everything I've tried fails to stop the macro, short of going in and commenting out every single line of each macro.

Thanks!
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
You can run this
VBA Code:
Sub StopEvents()
   Application.EnableEvents = False
End Sub
 
Upvote 0
Fluff’s answer is the way to go but I can’t help noticing your comment:-
short of going in and commenting out every single line of each macro
Just thought I would point out that you can select a block of code or all of the code and comment it out in one go.
In the VBE, go to VIEW, TOOLBARS and select the EDIT toolbar.
There is an icon to comment out a selected range and the icon to the right of that to uncomment the selection.

HTH
Paul.
 
Upvote 0
Surprisingly, Fluff's method didn't work for me. I can run that macro but things continue to run regardless.

Your solution is less elegant but perfectly effective. Thanks, Taul!
 
Upvote 0
Are the macros either worksheet or workbook event codes?
 
Upvote 0
Another thing you can try is to put the line

VBA Code:
Exit Sub

as the first line in the procedure. Then comment that out or not as your testing indicates. This allows some event procedures to run if need be.
 
Upvote 0
In that case disabling events should have worked.
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,262
Members
449,075
Latest member
staticfluids

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