Hi
I’ve added to following code to a project I’m working on to allow VBA to update locked cells.
****************************************
Private Sub Workbook_activate()
Dim wSheet As Worksheet
For Each wSheet In Worksheets
wSheet.Protect UserInterFaceOnly:=True '====>Allow all protected sheets to be updated by VBA
Next wSheet
End Sub
*******************************************
I’ve since added a password to protect the sheet and the above routine is failing. Can anyone tell me how I add the password to the VBA code???
Thanks
I’ve added to following code to a project I’m working on to allow VBA to update locked cells.
****************************************
Private Sub Workbook_activate()
Dim wSheet As Worksheet
For Each wSheet In Worksheets
wSheet.Protect UserInterFaceOnly:=True '====>Allow all protected sheets to be updated by VBA
Next wSheet
End Sub
*******************************************
I’ve since added a password to protect the sheet and the above routine is failing. Can anyone tell me how I add the password to the VBA code???
Thanks