Thread: Protection
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Protection

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