View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JE McGimpsey JE McGimpsey is offline
external usenet poster
 
Posts: 4,624
Default Disabling Events

One way:

Create a global variable (say "bSELECTIONCHANGE").

Then wrap your event macro:

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
If bSELECTIONCHANGE Then
'... your macro here...
End If
End Sub

Turn off the macro using

bSELECTIONCHANGE = False

and turn it back on with

bSELECTIONCHANGE = True



In article ,
"Patrick Simonds" wrote:

I use the following code to disable macros, but it is to indiscriminate.

Application.EnableEvents = True

Is there any way to disable only Private Sub Worksheet_SelectionChange
events and still allow other events to happen?