The attached code has been working fine.
I made some amendments to add additional code which caused errors so then deleted a when back to the original code but its not adding the date and time as it should. There are no errors its just as if its not there?
The sheet was protected so thought this could cause the issue? so have unportected the sheet and its still not doing anything.
The sheet is saved as Macro enabled any ideas??
Code
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 4 Then
Application.EnableEvents = False
If Not IsEmpty(Target) Then
Cells(Target.Row, 5).Value = Date + Time
Else
Cells(Target.Row, 5).ClearContents
End If
ElseIf Target.Column = 1 Then
Application.EnableEvents = False
If Not IsEmpty(Target) Then
Cells(Target.Row, 2).Value = Date + Time
Else
Cells(Target.Row, 2).ClearContents
End If
End If
Application.EnableEvents = True
End Sub
Display More