Hi all,
Currently I try to set multiple change events criteria on one worksheet. However, only the first criteria with range (I:I) seems to be working.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim A As Range: Set A = Range("I:I")
Dim v As String
If Intersect(Target, A) Is Nothing Then
Exit Sub
Application.EnableEvents = False
v = Target.Value
If v <> "" Then Target.Offset(0, -8) = Now()
If v = "" Then Target.Offset(0, -8) = ""
Application.EnableEvents = True
End If
Dim B As Range: Set B = Range("M:M")
Dim w As String
If Intersect(Target, B) Is Nothing Then
Exit Sub
Application.EnableEvents = False
w = Target.Value
If w = "Completed" Then Target.Offset(0, -1) = Now()
If w = "" Then Target.Offset(0, -1) = ""
Application.EnableEvents = True
End If
Currently I try to set multiple change events criteria on one worksheet. However, only the first criteria with range (I:I) seems to be working.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim A As Range: Set A = Range("I:I")
Dim v As String
If Intersect(Target, A) Is Nothing Then
Exit Sub
Application.EnableEvents = False
v = Target.Value
If v <> "" Then Target.Offset(0, -8) = Now()
If v = "" Then Target.Offset(0, -8) = ""
Application.EnableEvents = True
End If
Dim B As Range: Set B = Range("M:M")
Dim w As String
If Intersect(Target, B) Is Nothing Then
Exit Sub
Application.EnableEvents = False
w = Target.Value
If w = "Completed" Then Target.Offset(0, -1) = Now()
If w = "" Then Target.Offset(0, -1) = ""
Application.EnableEvents = True
End If