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

When the value in column B is changed, it fires the Worksheet_Change()
event again, and processing in the original event macro is suspended
until that change is dealt with (the Intersect in that case *should*
fail). You can prevent this with

Private Sub Worksheet_Change(ByVal Target As Range)
Dim isect As Range
Set isect = Application.Intersect(Target, Me.Range("E:E"))
If Not isect Is Nothing Then
With isect(1)
If .Value 0 Then
On Error Resume Next
Application.EnableEvents = False
.Offset(0, -3).Value = .Offset(0, -2).Value
Application.EnableEvents = True
On Error GoTo 0
End If
End With
End If
End Sub



In article ,
JLGWhiz wrote:

This is weird. Stepping through the code, if first jumps from the first If
Not to End Sub with isect not Set. Then it jumps back up to the second if,
Sets the isect and performs the events. It's nuts, but I am not getting the
variable not set message any more. It does not compute.