I have an important spreadsheet, which several people have access to and make changes to it.
I have come up with an idea, and would like to keep an AuditTrail so that if something goes horribly wrong with it, we have a record to look back and find out who did it, and when.
So far, i have a script which runs when the selection is changed, and takes a copy of the current row and pastes it onto a sheet called "AuditTrail".
The problem with this is that if the user scrolls up and down or left and right, you end up with lots of un-necessary rows on the audit trail... i want it to only copy the row if the content of any of the cells is changed.
Also, i would like to paste the information onto AuditTrail, but not at column A, i would like it pasted at Column C, with Column A and B being the date & time, and the username of the person who made the change.
Can anyone help me out on this please?
I have come up with an idea, and would like to keep an AuditTrail so that if something goes horribly wrong with it, we have a record to look back and find out who did it, and when.
So far, i have a script which runs when the selection is changed, and takes a copy of the current row and pastes it onto a sheet called "AuditTrail".
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Limit = Sheets("AuditTrail").Cells(Rows.Count, 1).End(xlUp).Row + 1
Rows(ActiveCell.Row).Copy Destination:=Sheets("AuditTrail").Rows(Limit)
End Sub
The problem with this is that if the user scrolls up and down or left and right, you end up with lots of un-necessary rows on the audit trail... i want it to only copy the row if the content of any of the cells is changed.
Also, i would like to paste the information onto AuditTrail, but not at column A, i would like it pasted at Column C, with Column A and B being the date & time, and the username of the person who made the change.
Can anyone help me out on this please?