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

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

Michael M

Well-known Member
Joined
Oct 27, 2005
Messages
21,475
Office Version
  1. 365
  2. 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
 

Forum statistics

Threads
1,181,606
Messages
5,930,869
Members
436,764
Latest member
avalladarez

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