How to lock all the sheets?

  • Thread starter Thread starter Pandi
  • Start date Start date
P

Pandi

I want to lock all the Sheets in my Workbook.
When I select more then one sheet and choose Protection>sheet
the function is disable. Only protection>Workbook is enable.
I don't want to Lock the workbook by password.
Tank
 
Pandi, you could use a macro to do it, something like this

Sub Protect_Sheets()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Protect password:="123"
Next ws
End Sub

And to unprotect them all at once

Sub Unprotect_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 2000 & 97
** remove news from my email address to reply by email **
 
Back
Top