Hi all, I found the perfect macro that does an audit trail which reflects the username, the cells that has been changed and what are the changes made. However, when i added in more worksheets to the workbook, the audit trail does not apply to the rest. \
Currently it only works on Sheet 1. I have a feeling that the changes to the code is only a minor amendment but can anyone take a look and let me know what i should add on or amend? Here's the codes for your reference. Thanks in advance.
Dim PreviousValue
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Value <> PreviousValue Then
Sheets("log").Cells(65000, 1).End(xlUp).Offset(1, 0).Value = _
Application.UserName & " changed cell " & Target.Address _
& " from " & PreviousValue & " to " & Target.Value
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
PreviousValue = Target.Value
End Sub
Bookmarks