Hi
I have been using the following code for a while to track changes to a row and logging date and username, plus change dates to the 1st of the month when entered. However, it has stopped working in the sense it no longer does the changes when a value changes on the row. Please help
I have been using the following code for a while to track changes to a row and logging date and username, plus change dates to the 1st of the month when entered. However, it has stopped working in the sense it no longer does the changes when a value changes on the row. Please help
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim changerow As Integer
Dim changeusername As String
changeusername = ReturnUserName()
changerow = Target.Row
Application.EnableEvents = False
Range("AO" & changerow).Value = Now()
Range("AP" & changerow).Value = changeusername
Application.EnableEvents = True
If Target.Column = 24 And IsDate(Target.Value) Then
Application.EnableEvents = False
Target.Value = DateSerial(Year(Target.Value), Month(Target.Value), 1)
Application.EnableEvents = True
End If
If Target.Column = 21 And IsDate(Target.Value) Then
Application.EnableEvents = False
Target.Value = DateSerial(Year(Target.Value), Month(Target.Value), 1)
Application.EnableEvents = True
End If
End Sub