Protecting multiple sheets

M

mik00725

Hi all,

Is there anyway of protecting multiple sheets at the same time b
just typing only one time the password. IE I select sheet1:sheet10
select open or closed for the appropiatte cells. How can I selec
sheet1:sheet10 and go to protect sheet and type the password only on
time and protect al this sheets?


thank
 
D

Dave Peterson

Can you use a macro:

Option Explicit
Sub testme()

Dim wks As Worksheet
Dim myPwd As String
Dim mySelectedSheets As Object
Dim myActiveSheet As Worksheet

Set mySelectedSheets = ActiveWindow.SelectedSheets
Set myActiveSheet = ActiveSheet

mySelectedSheets(1).Select True

myPwd = "hi there"

For Each wks In mySelectedSheets
With wks
If .ProtectContents _
Or .ProtectDrawingObjects _
Or .ProtectScenarios Then
'already protected!
'wanna unprotect them?
'.Unprotect Password:=myPwd
Else
.Protect Password:=myPwd
End If
End With
Next wks

mySelectedSheets.Select
myActiveSheet.Activate

End Sub
 

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