Does anyone know how to keep the undo along with worksheet change event. Here is my code that I am using.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
'TRACKS DATE ENTRY WAS MARKED AS COMPLETE AND WHO UPDATED IT
If Target.Column = 21 Then
Application.EnableEvents = False
For Each rng In Target
If rng.Offset(0, 3).Value = "" Then
rng.Offset(0, 3) = Now()
End If
Next rng
Application.EnableEvents = True
End If
If Target.Column = 21 Then
Application.EnableEvents = False
For Each rng In Target
rng.Offset(0, 4) = Environ("Username")
Next rng
Application.EnableEvents = True
End If
'TRACKS DATE ENTRY WAS MARKED AS DELETED AND WHO UPDATED IT
If Target.Column = 22 Then
Application.EnableEvents = False
For Each rng In Target
If rng.Offset(0, 4).Value = "" Then
rng.Offset(0, 4) = Now()
End If
Next rng
Application.EnableEvents = True
End If
If Target.Column = 22 Then
Application.EnableEvents = False
For Each rng In Target
rng.Offset(0, 5) = Environ("Username")
Next rng
Application.EnableEvents = True
End If
End Sub
Thank you
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
'TRACKS DATE ENTRY WAS MARKED AS COMPLETE AND WHO UPDATED IT
If Target.Column = 21 Then
Application.EnableEvents = False
For Each rng In Target
If rng.Offset(0, 3).Value = "" Then
rng.Offset(0, 3) = Now()
End If
Next rng
Application.EnableEvents = True
End If
If Target.Column = 21 Then
Application.EnableEvents = False
For Each rng In Target
rng.Offset(0, 4) = Environ("Username")
Next rng
Application.EnableEvents = True
End If
'TRACKS DATE ENTRY WAS MARKED AS DELETED AND WHO UPDATED IT
If Target.Column = 22 Then
Application.EnableEvents = False
For Each rng In Target
If rng.Offset(0, 4).Value = "" Then
rng.Offset(0, 4) = Now()
End If
Next rng
Application.EnableEvents = True
End If
If Target.Column = 22 Then
Application.EnableEvents = False
For Each rng In Target
rng.Offset(0, 5) = Environ("Username")
Next rng
Application.EnableEvents = True
End If
End Sub
Thank you