Thank you.
There are two codes - 1. named "Change History" in a standard module and
2. found in MasterSheet worksheet change event code module
The two codes are as below, Where do you want me to insert the above two codes.
Also, as you are aware, before the changes are logged a password is asked. Does the code take care of this too. (not asking password at all since the changes are not logged)
Please advise
Best regards
Vilas Desai
Code: Select all
Sub SetHistory(varUser, vPrevValue, vCurValue, sAddress)
Dim wshHist As Worksheet
Dim r As Long
Set wshHist = Worksheets("CHANGE_HISTORY")
r = wshHist.Cells.Find(What:="*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row + 1
wshHist.Cells(r, 1).Value = Now
wshHist.Cells(r, 2).Value = varUser
wshHist.Cells(r, 4).Value = vPrevValue
wshHist.Cells(r, 5).Value = vCurValue
wshHist.Cells(r, 6).Value = sAddress
End Sub
Code: Select all
Sub SetHistory(varUser, vPrevValue, vCurValue, sAddress)
Dim wshHist As Worksheet
Dim r As Long
Set wshHist = Worksheets("CHANGE_HISTORY")
r = wshHist.Cells.Find(What:="*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row + 1
wshHist.Cells(r, 1).Value = Now
wshHist.Cells(r, 2).Value = varUser
wshHist.Cells(r, 4).Value = vPrevValue
wshHist.Cells(r, 5).Value = vCurValue
wshHist.Cells(r, 6).Value = sAddress
End Sub