Temporarily Disabling an Event Macro

S

stratuser

I have an event macro on a worksheet. Sometimes, I want
to disable the event macro while I do some monthly
maintenance work on the data on the worksheet. I am
looking for ways to do this that don't require the user to
go into the VBA module (i.e., I don't want him to have to
comment out the VBA code). Any ideas?
 
J

J.E. McGimpsey

You could attach this to a button or keyboard shortcut:


Public Sub EventsToggle()
With Application
.EnableEvents = Not .EnableEvents
MsgBox "Event macros are " & _
IIf(.EnableEvents, "dis", "en") & "abled."
End With
End Sub
 
G

Guest

Excellent! Thank you very much.

-----Original Message-----
You could attach this to a button or keyboard shortcut:


Public Sub EventsToggle()
With Application
.EnableEvents = Not .EnableEvents
MsgBox "Event macros are " & _
IIf(.EnableEvents, "dis", "en") & "abled."
End With
End Sub


.
 
Top