Worksheet protection

  • Thread starter Thread starter Patrick Simonds
  • Start date Start date
P

Patrick Simonds

I have a work book with over 120 worksheets. Is there any way to set the
worksheet protection on all worksheets so that a user can only select
unlocked cells. I know I can do this by selecting each worksheet, one at a
time, and deselecting all options but "select unlocked cells", but that
will be very time consuming.
 
Patrick

A macro will do what you want.

Sub ProtectAllSheets()
Application.ScreenUpdating = False
Dim n As Single
For n = 1 To Sheets.Count
With Sheets(n)
.Protect Password:="justme"
.EnableSelection = xlUnlockedCells
End With
Next n
Application.ScreenUpdating = True
End Sub

To unprotect all sheets just change .Protect to . UnProtect


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top