Protecting/unprotecting multiple sheets at a time

H

Hall

I can protect locked cells in a sheet using Tools->Protection->Protect
Sheet. But I seem to have to do that for each sheet of my workbook,
entering the password twice and specifying what I want to allow each time!

Is there a way to specify a protection of all sheets at one time? What
about to unprotect?

The menu function Protect Workbook doesn't seem to protect the locked cells
the way Protect Sheet does.

Thanks!
 
E

Earl Kiosterud

Hall,

The only thing I know of to protect multiple workbooks is via a macro. Same
for unprotect.

The Protect Workbook isn't intended to protect the innards of a sheet
(locked cells). It's to keep sheets from being deleted, moved, added, etc.
A different area of protection.
 
G

Gord Dibben

Hall

Not possible without using VBA.

Couple of Macros you can use.

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

Sub UnprotectAllSheets()
Application.ScreenUpdating = False
Dim N As Single
For N = 1 To Sheets.Count
Sheets(N).Unprotect Password:="justme"
Next N
Application.ScreenUpdating = True
End Sub

Gord Dibben 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

Top