Hi Everyone,
I have a fairly limited experience of VBA but have managed to incorporate the below code to update Colulmns O, P, and Q with the date of last update (Column O), cell updated (Column P), and last updated by (Column Q) for any changes made in the target range R2:AK1000:
What I'm aiming to do is to password protect the entire sheet with Column O, Column P, and Column Q all locked but where the VBA code can still automatically update these columns when changes are made as per the original (above) code. In the target range (R2:AK1000) there is a mixed economy of locked and unlocked columns/cells. I've searched potential solutions on the web but can't seem to find an answer to my specific VBA code.
Excel version: 365 (but running in the application)
Operating system: Windows 10
Any help is appreciated! Many thanks in advance!
I have a fairly limited experience of VBA but have managed to incorporate the below code to update Colulmns O, P, and Q with the date of last update (Column O), cell updated (Column P), and last updated by (Column Q) for any changes made in the target range R2:AK1000:
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Intersect(Target, Range("R2:AK1000")) Is Nothing Then Exit Sub
Cells(Target.Row, "O") = Now()
Cells(Target.Row, "P") = Target.Address(RowAbsolute:=False)
Cells(Target.Row, "Q") = Application.UserName
Application.EnableEvents = True
End Sub
What I'm aiming to do is to password protect the entire sheet with Column O, Column P, and Column Q all locked but where the VBA code can still automatically update these columns when changes are made as per the original (above) code. In the target range (R2:AK1000) there is a mixed economy of locked and unlocked columns/cells. I've searched potential solutions on the web but can't seem to find an answer to my specific VBA code.
Excel version: 365 (but running in the application)
Operating system: Windows 10
Any help is appreciated! Many thanks in advance!