A
a
I received a reply to my question about Binzelli and it was quite
helpful. Unfortunately, it was limited to changes in cells - not groups
of cells, inserting columns, etc.
Is there anybody out there that can expand on Binzelli procedure? I
changed the log to include "formula" instead of "value" and I added who
made the change using document properties and also added the time that
the change was made. Unfortunately, I left this at work so I don't have
an example.
But, as you can see, the code does what I asked - I just didn't ask for
enough.
Any help would be much appreciated, because, as I said before, I'm on a
really tight deadline and I'm very concerned that I won't be able to
come through with anything worthwhile.
Thanks very much in advance,
Anita
Anita,
No problem, use the Worksheet_Change event in the code for the sheet you
want to "track" (right click on the sheet tab and select the menu item to
add code to that sheet)
The code below writes the change to a sheet called "Log"
The row used to write the last change is stored in cell B1 and is
incremented each time the event fires.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Lastrow As Long
Lastrow = ActiveWorkbook.Sheets("Log").Range("B1").Value
'Write the Change
ActiveWorkbook.Sheets("Log").Cells(Lastrow + 1, 1) = "Sheet (name) - Row " &
Target.Row & " - Column " & Target.Column & " changed to: " & Target.Value
'Increase the LastRow value by 1
ActiveWorkbook.Sheets("Log").Range("B1").Value = Lastrow + 1
End Sub
Good luck
helpful. Unfortunately, it was limited to changes in cells - not groups
of cells, inserting columns, etc.
Is there anybody out there that can expand on Binzelli procedure? I
changed the log to include "formula" instead of "value" and I added who
made the change using document properties and also added the time that
the change was made. Unfortunately, I left this at work so I don't have
an example.
But, as you can see, the code does what I asked - I just didn't ask for
enough.
Any help would be much appreciated, because, as I said before, I'm on a
really tight deadline and I'm very concerned that I won't be able to
come through with anything worthwhile.
Thanks very much in advance,
Anita
Anita,
No problem, use the Worksheet_Change event in the code for the sheet you
want to "track" (right click on the sheet tab and select the menu item to
add code to that sheet)
The code below writes the change to a sheet called "Log"
The row used to write the last change is stored in cell B1 and is
incremented each time the event fires.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Lastrow As Long
Lastrow = ActiveWorkbook.Sheets("Log").Range("B1").Value
'Write the Change
ActiveWorkbook.Sheets("Log").Cells(Lastrow + 1, 1) = "Sheet (name) - Row " &
Target.Row & " - Column " & Target.Column & " changed to: " & Target.Value
'Increase the LastRow value by 1
ActiveWorkbook.Sheets("Log").Range("B1").Value = Lastrow + 1
End Sub
Good luck