View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz JLGWhiz is offline
external usenet poster
 
Posts: 3,986
Default Worksheet_Change

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.

"JE McGimpsey" wrote:

Perhaps Target doesn't include any cells in column E?

Possible solution:

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 _
.Offset(0, -3).Value = .Offset(0, -2).Value
End With
End If
End Sub


In article ,
JLGWhiz wrote:

Can anybody see why the object variable will not set? I can't, but it won't.
Appreciate another set of eyeballs looking at this.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim isect As Range
Set isect = Application.Intersect(Target, Range("E:E"))
If isect 0 Then
Me.Range("B" & Target.Row).Value = Me.Range("C" & Target.Row).Value
End If

End Sub