Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm trying to use a button to protect/unprotect a sheet. But, I'm not sure
what I should use in the If statement to identify whether the sheet is protected or not. Private Sub cmdProtect_Click() With ActiveSheet If ActiveSheet.ProtectionMode Then ' not working, it's always True .Unprotect Password:="password" cmdProtect.BackColor = &HFFFF00 cmdProtect.Caption = "UnProtected" Else .Protect Password:="password", _ Contents:=True, UserInterfaceOnly:=True cmdProtect.BackColor = &HFF& cmdProtect.Caption = "Protected" End If End With End Sub Can anybody help? Thanks |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Protect/ unprotect worksheet | Excel Discussion (Misc queries) | |||
How do I unprotect a protected worksheet that has passwrod protect | Excel Discussion (Misc queries) | |||
Protect/Unprotect Worksheet | Excel Discussion (Misc queries) | |||
Unprotect and protect.... | Excel Programming | |||
Excel VBA - Problems using Protect/Unprotect a worksheet | Excel Programming |