Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 -- hotherp ----------------------------------------------------------------------- hotherps's Profile: http://www.excelforum.com/member.php...nfo&userid=505 View this thread: http://www.excelforum.com/showthread.php?threadid=32005 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I protect a number of sheets allowing the user to add a com | New Users to Excel | |||
password protect sheets | Excel Worksheet Functions | |||
Protect Excel sheets with Password Using VBA | Excel Programming | |||
Protecting Multiple sheets with prompt for password to unprotect | Excel Programming |