View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
MarkN MarkN is offline
external usenet poster
 
Posts: 104
Default can you protect multiple worksheets at thr same time

Hello,

Press [Alt][F11] on the keyboard to open the VB Editor.
Double click on This Workbook under the Microsoft Excel Objects.
-Paste this into the right of the screen:
Sub protectSheets()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Protect password:="test"
Next ws
End Sub

Sub unprotectSheets()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Unprotect password:="test"
Next ws
End Sub

-Change the word test if you want but leave what you change it to inside
double inverted commas.
-When you want to protect, click on the Tools menu, point to Macro and
select Macros...
-Click the one you want and click OK.

--
Hope this helps,
MarkN


"mlpmlb" wrote:

I have several multiple sheet workbooks where I need to protect the cells
that have formulas in them. is there a way I can protect serveral worksheets
at the same time? When I need to make changes to several of the worksheets it
takes forever to go in an unprotect each one, make the changes and then
proect each one again.I tried selecting them all but then the protection is
not an option avalible.

Thank you!