Hi Excel wizards,
I'm trying to run this macro in the worksheet but only the first two if formulas are working. The last one if the condition is "Ceased" does not seem to work. Kindly advice on how to fix the VBA code.
I'm trying to run this macro in the worksheet but only the first two if formulas are working. The last one if the condition is "Ceased" does not seem to work. Kindly advice on how to fix the VBA code.
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("H:H")) Is Nothing Then
If Target <> "" Then
Target.Offset(0, -6) = Now
Else
Target.Offset(0, -6) = ""
End If
ElseIf Not Intersect(Target, Range("J:J")) Is Nothing Then
If Target = "Completed" Then
Target.Offset(0, -1) = Now
ElseIf Target = "" Then
Target.Offset(0, -1) = ""
End If
ElseIf Not Intersect(Target, Range("J:J")) Is Nothing Then
If Target = "Ceased" Then
Target.Offset(0, 19) = Now
ElseIf Target = "" Then
Target.Offset(0, 19) = ""
End If
End Sub