turn off worksheet_change during run of procedure

Laavista

Board Regular
Joined
Aug 27, 2009
Messages
79
Thanks to the help in this forum, I was able to successfully create a "worksheet_change" where a message is displayed if the user changes a value in a critical cell.

Now I need to find out if there's a way to 'turn off' the worksheet_change when running another procedure. I have a procedure that checks the critical cell value for errors, and it brings up the message for each row.

Thanks for your help!!
 
Code:
Sub Test()

Application.EnableEvents = False   ' turn off all other macros for now

...code
...code
...code

Application.EnableEvents = True   ' turn other macros back on
End Sub


Be careful here. When you turn off macros like this, your macro needs good error handling built in so that when an error occurs, macros get turned back on.
 
Upvote 0
Try

Code:
Application.EnableEvents = False
'
'your code
'
Application.EnableEvents = True
 
Upvote 0

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