Wondering if someone could help me with this code. What I am attempting to do is add a date into cell K when a number is entered into cell C. But, if cell C is modified and there is already a date in cell K, then do nothing. But, I also want to delete the date in cell K if the number in cell C is deleted. But, the way I have it written, it exits the sub too early, and I can't figure out how to re-write it. Thanks
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
'Adds date/time in column "K" when P/N is entered in column "C"
If Not Intersect(Target, Range("C:C")) Is Nothing Then
On Error Resume Next
Application.EnableEvents = False
If Target > 1 Then
[COLOR=red]If Target.Offset(0, 8) > 1 Then Exit Sub[/COLOR]
With Target.Offset(0, 8)
.Value = "=NOW()"
.Value = .Value
End With
End If
If Target < 1 Then
Target.Offset(0, 8).ClearContents
End If
Application.EnableEvents = True
End If
End Sub