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

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