View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
J.E. McGimpsey J.E. McGimpsey is offline
external usenet poster
 
Posts: 493
Default Temporarily Disabling an Event Macro

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

In article ,
"stratuser" wrote:

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?