Worksheet protection

greyseal

New Member
Joined
Aug 10, 2010
Messages
1
G'day. I maintain a monthly roster in Excel. There are 20 - 22 worksheets, depending on the number of days in the month, that require protection. Is there any simple way to protect multiple worksheets at the same time, or do they need to be done independently?

Looking forward to your replies.
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

Michael M

Well-known Member
Joined
Oct 27, 2005
Messages
20,342
Office Version
  1. 2016
  2. 2013
  3. 2007
Platform
  1. Windows
Hi
try these
Code:
Sub unprotect_all_ws()
Dim ws As Worksheet
For Each ws In Worksheets
ws.Unprotect "password"
Next ws
End Sub


Sub protect_all_ws()
Dim ws As Worksheet
For Each ws In Worksheets
ws.Protect "password"
Next ws
End Sub

Change "password" to suit
 

Watch MrExcel Video

Forum statistics

Threads
1,132,741
Messages
5,655,028
Members
418,171
Latest member
ramiroayala

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top