H
hotherps
When I run this code in the open workbook event. It locks all of th
formulas but still allows the use of command buttons.
But if I uncomment the line below it promps the user for a passwor
once for each sheet in the workbook(9 shts)
If I comment it out it protects everything I want but protection can b
turned off without a password
Dim Sht As Worksheet
Const Pass As String = "hello"
On Error Resume Next
For Each Sht In ThisWorkbook.Worksheets
With Sht
.Protect UserInterFaceOnly:=True
'.Unprotect Password:=Pass
.cells.Locked = False
.cells.SpecialCells(xlCellTypeFormulas).Locked = True
.Protect Password:=Pass
End With
Next Sh
formulas but still allows the use of command buttons.
But if I uncomment the line below it promps the user for a passwor
once for each sheet in the workbook(9 shts)
If I comment it out it protects everything I want but protection can b
turned off without a password
Dim Sht As Worksheet
Const Pass As String = "hello"
On Error Resume Next
For Each Sht In ThisWorkbook.Worksheets
With Sht
.Protect UserInterFaceOnly:=True
'.Unprotect Password:=Pass
.cells.Locked = False
.cells.SpecialCells(xlCellTypeFormulas).Locked = True
.Protect Password:=Pass
End With
Next Sh