ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Protecting multiple worksheets (https://www.excelbanter.com/excel-programming/350335-protecting-multiple-worksheets.html)

Will

Protecting multiple worksheets
 
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

Paul B

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





All times are GMT +1. The time now is 06:01 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com