I'm trying to create a spread sheet for version tracking but have a separate sheet capturing changes to the first sheet and need to include some additional information. This is the script currently running.
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If Sh.Name = "Log" Then Exit Sub
Application.EnableEvents = False
On Error Resume Next
With Sheets("Log").Cells(Rows.Count, 1).End(xlUp)
.Offset(1, 0).Value = Environ("UserName")
.Offset(1, 1) = Sh.Name
.Offset(1, 3) = Target.Address
.Offset(1, 4) = "'" & Target.Formula
.Offset(1, 5) = Previous
Previous = ""
.Offset(1, 6) = Now
End With
Application.EnableEvents = True
End Sub
The cell that is modified is captured in column 3 as Target.Address. I would like to be able to reference the Target.Address's Row and display the value of column A on the same row from the first sheet. .
For example : Cell D7 is modified on sheet 1. Log sheet shows $D$7 as the value of the Target Address. In another cell i would like to know what the value of A7 is sense the row of the target.address was 7. It would sit in the .Offset(1, 2) = spot missing from the example as i was trying out different formulas instead of using vba.
Tried looking and having a hard time finding or wording the question properly i'm afraid.
Any suggestions would be greatly appreciated! Thank you in advance,