Heres another way of doing it.
And as you are changing cell contents via the macro you should also use Application.EnableEvents in your code to stop the macro change event being triggered when the macro changes the contents.
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, _
Range("A2:A101", "D2:D50")) Is Nothing Then
Application.EnableEvents = False
If IsEmpty(Target) Then
Target.Offset(0, 4).Value = ""
Target.Offset(0, 1).Value = ""
Else
Target.Offset(0, 4).Value = Application.UserName
Target.Offset(0, 1).Value = Date
End If
End If
Application.EnableEvents = True
End Sub
Bookmarks