View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Paul B Paul B is offline
external usenet poster
 
Posts: 709
Default Protecting multiple worksheets

Will, this will protect and unprotect all sheets in the workbook,

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

"will" wrote in message
...
I have a workbook with about 15 worksheets in it.

I want everyone to be able to look at this without being able to change

it,
and one person to be able to change it.

I dont want to go down the "open read-only unless you have a password"
route, as this still means that everyone can change the data, even if they
cannot save it.

However, if I go down the "protect sheet" route, then the 1 person who is
allowed to change the data will have 15 sheets to unprotect and then
reprotect each time he goes in and changes something.

Is there any other way of achieving what I want?

Thanks,

Will