Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
All,
I have the following code to protect sheet, then unlock cetain cell based on the login. So people can onlu modify certain cells. And the protect the sheet with password, so no one can unprotect the shee without the password: ActiveSheet.Unprotect Range("I4:N6").Select Selection.Locked = False Selection.FormulaHidden = False ActiveSheet.Protect ActiveSheet.Protect DrawingObjects:=True, Contents:=True Scenarios:=True ActiveSheet.Protect Password:="1234567" But it doesn't work. It ask me for password. Any suggestion will be appreciated -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try:
Const PWORD As String = "1234567" With ActiveSheet .Unprotect Password:=PWORD With .Range("I4:N6") .Locked = False .FormulaHidden = False End With .Protect Password:=PWORD End With In article , dragontale wrote: All, I have the following code to protect sheet, then unlock cetain cells based on the login. So people can onlu modify certain cells. And then protect the sheet with password, so no one can unprotect the sheet without the password: ActiveSheet.Unprotect Range("I4:N6").Select Selection.Locked = False Selection.FormulaHidden = False ActiveSheet.Protect ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True ActiveSheet.Protect Password:="1234567" But it doesn't work. It ask me for password. Any suggestion will be appreciated. --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
I need to unprotect sheet so I cn sve it but need a password? | Excel Discussion (Misc queries) | |||
Code to protect/unprotect a sheet using a macro with password | Excel Discussion (Misc queries) | |||
Forgot the password (to unprotect a sheet) | Excel Discussion (Misc queries) | |||
Password - Protect, UnProtect | Excel Programming | |||
VBA code - protect and unprotect a sheet | Excel Programming |