I have some VBA that I am using to trigger a time stamp when I type into certain cells. The problem is that even if the time stamp has already been triggered and the cell is filled in with the time, it will continue to update the time if I keep updating the cells that trigger it. Is there a way to have it so that if the cells already have a time in it, it will stop the updating of the time? Here is the current code I am using:
VBA Code:
' type in columns A-C to do a time stamp in column D.
With Target
If .Count > 1 Then Exit Sub
If Not Intersect(Range("A:C"), .Cells) Is Nothing Then
Application.EnableEvents = False
With Range("D" & Target.Row)
If Not IsDate(.Value) Then
.NumberFormat = "HH:MM"
.Value = Now
End If
End With
Application.EnableEvents = True
End If
End With
' same as above but different range and target
With Target
If .Count > 1 Then Exit Sub
If Not Intersect(Range("F:O"), .Cells) Is Nothing Then
Application.EnableEvents = False
With Range("E" & Target.Row)
If Not IsDate(.Value) Then
.NumberFormat = "HH:MM"
.Value = Now
End If
End With
Application.EnableEvents = True
End If
End With