Protect all sheets at once

M

~me~

I have a workbook with about 30 pages. I want to be able to protect and
unprotect them all at once. I cannot select all sheets and then protect them
because the option will not be available. Any Ideas?
TIA
Wayne
 
D

davegb

~me~ said:
I have a workbook with about 30 pages. I want to be able to protect and
unprotect them all at once. I cannot select all sheets and then protect them
because the option will not be available. Any Ideas?
TIA
Wayne

I have a couple of macros I use to protect/unprotect each worksheet in
large workbooks. I have them assigned to buttons on a custom toolbar I
use when developing worksheets. If you'd like me to post the macros,
I'd be happy to. If you don't know how to implement them, I can
explain.
 
P

Paul B

Wayne,

Sub Protect_All_Sheets()

Dim ws As Worksheet

For Each ws In ThisWorkbook.Worksheets

ws.Protect password:="123"

Next ws

End Sub



Sub Unprotect_All_Sheets()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Unprotect password:="123"
Next ws
End Sub
--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003
 
M

~me~

Paul,
Thank you very much, that was perfect, I just altered it a tad to allow for
formatting and took out the password.
Thank you I appreciate your help
Wayne
 
P

Paul B

Your welcome

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003
 
E

EdMac

The other alternative is to download ASAP utilities which provides this
as one of the many additional add-ins.

Ed
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top