ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Protecting multiple sheets (https://www.excelbanter.com/excel-discussion-misc-queries/13426-protecting-multiple-sheets.html)

mik00725

Protecting multiple sheets
 

Hi all,

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


thanks


--
mik00725
------------------------------------------------------------------------
mik00725's Profile: http://www.excelforum.com/member.php...o&userid=16169
View this thread: http://www.excelforum.com/showthread...hreadid=345946


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

mik00725 wrote:

Hi all,

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

thanks

--
mik00725
------------------------------------------------------------------------
mik00725's Profile: http://www.excelforum.com/member.php...o&userid=16169
View this thread: http://www.excelforum.com/showthread...hreadid=345946


--

Dave Peterson


All times are GMT +1. The time now is 02:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com