B
Ben Dummar
I am trying to combine the two intersect ranges below into one macro that is
in a worksheet tab. The outside if range works but the inside one doesn't.
What do I need to do to fix it?
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim R As Long
R = Target.Row
On Error GoTo ErrHandler
Application.EnableEvents = True
If Not Intersect(Range("L2:m20"), Target) Is Nothing Then
If Not Intersect(Range("A2:B2"), Target) Is Nothing Then
End If
If Target.Column <> 9 Then Exit Sub
If Target.Row = 1 Then Exit Sub
Target.Offset(0, -2).Value = Date '<<== CHECK RANGE
End If
If Target.Column <> 2 Then Exit Sub
If Target.Row = 1 Then Exit Sub
Target.Offset(0, 2).Value = Date
ErrHandler:
Application.EnableEvents = True
End Sub
Thanks,
Ben
in a worksheet tab. The outside if range works but the inside one doesn't.
What do I need to do to fix it?
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim R As Long
R = Target.Row
On Error GoTo ErrHandler
Application.EnableEvents = True
If Not Intersect(Range("L2:m20"), Target) Is Nothing Then
If Not Intersect(Range("A2:B2"), Target) Is Nothing Then
End If
If Target.Column <> 9 Then Exit Sub
If Target.Row = 1 Then Exit Sub
Target.Offset(0, -2).Value = Date '<<== CHECK RANGE
End If
If Target.Column <> 2 Then Exit Sub
If Target.Row = 1 Then Exit Sub
Target.Offset(0, 2).Value = Date
ErrHandler:
Application.EnableEvents = True
End Sub
Thanks,
Ben