temporary disable a macro

still learning

Well-known Member
Joined
Jan 15, 2010
Messages
622
Office Version
  1. 365
Platform
  1. Windows
Hi
I have a long change event macro that I want to disable once in a while to edit data or formulas.
What I do now is put an ' in front of every line, then delete it when I done.
I tried using the (in my case) red dot at the start of the macro, but then instead of not running, I get the error---debug message
I'm wondering if there is an easier way

mike
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,671
Office Version
  1. 365
Platform
  1. Windows
You can enter this in the immediate window & press enter
VBA Code:
Application.EnableEvents = False
then when you've finished, change False to true & hit enter again.
 

still learning

Well-known Member
Joined
Jan 15, 2010
Messages
622
Office Version
  1. 365
Platform
  1. Windows
Hi Fluff,
hope all is good
Let me show yo my stupidity.
Where to i put it.? In the change event macro at the beginning?
I'm away from my program and can't try it.

mike
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,671
Office Version
  1. 365
Platform
  1. Windows
No, you can just put it in the immediate window, normally below the code window Ctrl G will bring it up if it's not there.
 

still learning

Well-known Member
Joined
Jan 15, 2010
Messages
622
Office Version
  1. 365
Platform
  1. Windows
Thanks Fluff
I didn't know there was such a thing.
It worked perfect
mike
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,671
Office Version
  1. 365
Platform
  1. Windows
You're welcome & thanks for the feedback.
 

Watch MrExcel Video

Forum statistics

Threads
1,129,795
Messages
5,638,370
Members
417,023
Latest member
Zimbo38

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
Top