Log specific changes

S

Sam

I have code in a workbook_BeforeSave event that Appends a txt file with an
entry that stamps user & date/time when the file is saved. I would like to
log any specific cells that are changed. The workbook has many worksheets and
I can conditionally choose the time period that I want to track the changes.
If cell $C$5 on sheet3 is changed, I want to log this and any other sheets
that are changed.

Thanks,

Sam
 
A

AndyM

This code should give you a start. The allChanges variable will keep track
of each change made in the workbook. You may need to add additional code to
track the sheet the change was made on. This code should be put into the
ThisWorkbook module.

Public allChanges As String
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
allChanges = allChanges & "Cell(" & Target.row & "," & Target.Column & _
") changed to '" & Target.Value & "'" & vbCrLf
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top