that_one_girl
New Member
- Joined
- Mar 22, 2017
- Messages
- 43
Hello Again,
I have a code running (code below) that is copying data from one master sheet, to one of 2 other sheets based on criteria.
What I need to do now, is add a code to this (for the whole workbook) that will track changes made. So if by example, John opens the book, and enters a new line of data, but accidentally types it over the last row of data instead of entering a new line,
I need to track
Who changed information
What information they changed (before change)
What Column and Row it was on (I prefer D9 listing vs. 9,4 if possible)
The worksheet that information was on
When they changed it
and I would like these changes to be stored on a worksheet that I will have hidden.
Here's the current code I have for the workbook:
Private Sub Workbook_Open()
Dim i, LastRow
LastRow = Sheets("ALL RECORDS").Range("A" & Rows.Count).End(xlUp).Row
Sheets("ACTIVE").Range("A2:L60869").ClearContents
Sheets("ARCHIVED").Range("A2:L60869").ClearContents
For i = 2 To LastRow
If Sheets("ALL RECORDS").Cells(i, "J").Value = "CURRENT" Then
Sheets("ALL RECORDS").Cells(i, "J").EntireRow.Copy Destination:=Sheets("ACTIVE").Range("A" & Rows.Count).End(xlUp).Offset(1)
ElseIf Sheets("ALL RECORDS").Cells(i, "J").Value = "ARCHIVE" Then
Sheets("ALL RECORDS").Cells(i, "J").EntireRow.Copy Destination:=Sheets("ARCHIVED").Range("A" & Rows.Count).End(xlUp).Offset(1)
End If
Next
End Sub
I have a code running (code below) that is copying data from one master sheet, to one of 2 other sheets based on criteria.
What I need to do now, is add a code to this (for the whole workbook) that will track changes made. So if by example, John opens the book, and enters a new line of data, but accidentally types it over the last row of data instead of entering a new line,
I need to track
Who changed information
What information they changed (before change)
What Column and Row it was on (I prefer D9 listing vs. 9,4 if possible)
The worksheet that information was on
When they changed it
and I would like these changes to be stored on a worksheet that I will have hidden.
Here's the current code I have for the workbook:
Private Sub Workbook_Open()
Dim i, LastRow
LastRow = Sheets("ALL RECORDS").Range("A" & Rows.Count).End(xlUp).Row
Sheets("ACTIVE").Range("A2:L60869").ClearContents
Sheets("ARCHIVED").Range("A2:L60869").ClearContents
For i = 2 To LastRow
If Sheets("ALL RECORDS").Cells(i, "J").Value = "CURRENT" Then
Sheets("ALL RECORDS").Cells(i, "J").EntireRow.Copy Destination:=Sheets("ACTIVE").Range("A" & Rows.Count).End(xlUp).Offset(1)
ElseIf Sheets("ALL RECORDS").Cells(i, "J").Value = "ARCHIVE" Then
Sheets("ALL RECORDS").Cells(i, "J").EntireRow.Copy Destination:=Sheets("ARCHIVED").Range("A" & Rows.Count).End(xlUp).Offset(1)
End If
Next
End Sub