Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is there a way to programatically protect all the formulas
in a multiple sheet file, and also not allow row insertions or deletions? TIA |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
For Each Wks In Application.Workbooks(1).Worksheets
Wks.Protect "optionalpassword" Next Application.Workbooks(1).Protect "optionalpassword" Note that cells need to be locked (which they are by default) for protection to do anything about changing or hiding forumulas. "Eva Shanley" wrote: Is there a way to programatically protect all the formulas in a multiple sheet file, and also not allow row insertions or deletions? TIA |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
for each sh in ActiveWorkbook.Worksheets
sh.Activate set rng = nothing if sh.Protectcontents then sh.Unprotect password:="ABCD" end if On error resume next set rng = sh.SpecialCells(xlFormulas) On error goto 0 if not rng is nothing then _ rng.locked = True sh.Protect Password:="ABCD" Next -- Regards, Tom Ogilvy "Eva Shanley" wrote in message ... Is there a way to programatically protect all the formulas in a multiple sheet file, and also not allow row insertions or deletions? TIA |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
So I still need to unprotect the range a user can key into
first, correct? -----Original Message----- for each sh in ActiveWorkbook.Worksheets sh.Activate set rng = nothing if sh.Protectcontents then sh.Unprotect password:="ABCD" end if On error resume next set rng = sh.SpecialCells(xlFormulas) On error goto 0 if not rng is nothing then _ rng.locked = True sh.Protect Password:="ABCD" Next -- Regards, Tom Ogilvy "Eva Shanley" wrote in message ... Is there a way to programatically protect all the formulas in a multiple sheet file, and also not allow row insertions or deletions? TIA . |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Unlock, not unprotect.
but the sheet can't be protected when you unlock the cells. -- Regards, Tom Ogilvy "Eva Shanley" wrote in message ... So I still need to unprotect the range a user can key into first, correct? -----Original Message----- for each sh in ActiveWorkbook.Worksheets sh.Activate set rng = nothing if sh.Protectcontents then sh.Unprotect password:="ABCD" end if On error resume next set rng = sh.SpecialCells(xlFormulas) On error goto 0 if not rng is nothing then _ rng.locked = True sh.Protect Password:="ABCD" Next -- Regards, Tom Ogilvy "Eva Shanley" wrote in message ... Is there a way to programatically protect all the formulas in a multiple sheet file, and also not allow row insertions or deletions? TIA . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel Data Protection Best Practice: AKA: Real Sheet Protection | Excel Discussion (Misc queries) | |||
Excel Data Protection- AKA: Sheet/Macro Password Protection | Setting up and Configuration of Excel | |||
WS Protection: Different Levels of Protection on Different Ranges | Excel Discussion (Misc queries) | |||
Cell Protection vs. Worksheet Protection | Excel Discussion (Misc queries) | |||
Worksheet protection is gone and only wokbook protection can be se | Excel Discussion (Misc queries) |