View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Greg Greg is offline
external usenet poster
 
Posts: 331
Default protect multiple sheets at one time with options

THANK YOU! that worked great on the unlocked cells can i apply this to locked
cells as well? i have some cells locked so they can not alter the formulas

Once again Michael i appreciate all your time.

"Michael" wrote:

Try this:
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets

ws.Protect Password:=""
ws.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
, AllowFormattingCells:=True, AllowFormattingColumns:=True, _
AllowFormattingRows:=True
Next ws
--
If this posting was helpful, please click on the Yes button.
Regards,

Michael Arch.




"Greg" wrote:

Thanks for the fast response!
i'm using Office 07 but users are 03
when i inserted your code i was not able to change any formatting. i may
have put it in the wrong place.

here is the code i'm using now:

Sub protect_sheets()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Protect Password:=""
Next ws

"Michael" wrote:

If you are using Excel 2003 use the following statement:

ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
, AllowFormattingCells:=True, AllowFormattingColumns:=True, _
AllowFormattingRows:=True

This is not allowed in lower Excel Versions.
--
If this posting was helpful, please click on the Yes button.
Regards,

Michael Arch.




"Greg" wrote:

i have 50+ pages to protect. i have the code to protect and unprotect all the
pages at once.
my question is:
How can i add code so the user to change font, color, etc.. in these
protected sheets?


any and all help would greatly be appreciated
Many thanks in advance.

Greg