View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Stop Capture Event

Test the cell being changed

'-----------------------------------------------------------------
Private Sub Worksheet_Change(ByVal Target As Range)
'-----------------------------------------------------------------
Const WS_RANGE As String = "H1:H10"

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
'do your stuff
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"OverAC" wrote in
message ...

Dears,

Sometimes I work with worksheet event to capture change event, but
right after that event I change some other things in this sheet but I
dont want worksheet_Change event procedure run like a recursion. So I
want VBA to capture this event. How can I do this?

Thanks for any reply

OverAC

-------
English is not my mother tounge, hope that you can understand what I
want to explain


--
OverAC
------------------------------------------------------------------------
OverAC's Profile:

http://www.excelforum.com/member.php...o&userid=32396
View this thread: http://www.excelforum.com/showthread...hreadid=531826