I have this line of code in my worksheet:
It works great to delete the entries in columns I, J and K.....IF I backspace the entry out in any cell in my C column. But if I "clear contents" of any cell in my C column the entries remain in my last 3 columns. How can I fix this to work so no matter what I do..... clear or delete or cut and paste somewhere else if the value in any cell in the C column is blank then it clears the entries in my last 3 columns?
Thanks in advance.
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("C4:C1002")) Is Nothing Then Exit Sub
If Target.Count > 1 Then Exit Sub
Application.EnableEvents = False
With Target
If .Value = "" Then
.Offset(, 6).Value = ""
.Offset(, 7).Value = ""
.Offset(, 8).Value = ""
Else
.Offset(, 6).Value = Environ("username")
.Offset(, 7).Value = Date
.Offset(, 8).Value = Time
End If
End With
Application.EnableEvents = True
End Sub
It works great to delete the entries in columns I, J and K.....IF I backspace the entry out in any cell in my C column. But if I "clear contents" of any cell in my C column the entries remain in my last 3 columns. How can I fix this to work so no matter what I do..... clear or delete or cut and paste somewhere else if the value in any cell in the C column is blank then it clears the entries in my last 3 columns?
Thanks in advance.