Protecting worksheets

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a workbook containing some 250 worksheets.

Is there some way to protect all worksheets in a workbook instead of having
to protect each one individually?

Thanks,

Bryan
 
This should do it.

Sub protectall()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Select
ActiveSheet.Protect Password:="yourpassword"
Next ws
End Sub

Mike
 
How would the script be changed to unprotect all the worksheets?

Thanks for your help,

Bryan
 
By having a second macro very similar to the one below and cunningly adding

UN in front of protect.

Mike
 
Back
Top