Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
Is there a way to select and password protect multiple sheets in an excel
workbook, or must you do them one by one? |
#2
![]() |
|||
|
|||
![]()
If you're doing it manually, you have to do it one by one.
But you could have a little macro do it for you. 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 Just group your sheets you want protected first. If you're new to macros, you may want to read David McRitchie's intro at: http://www.mvps.org/dmcritchie/excel/getstarted.htm carter wrote: Is there a way to select and password protect multiple sheets in an excel workbook, or must you do them one by one? -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Password Protection - Excel | Excel Discussion (Misc queries) | |||
Excel on XP: Password Protection | Excel Discussion (Misc queries) | |||
How to define separate Password Protection, to say 3 persons, for. | Excel Worksheet Functions | |||
How to define separate Password Protection, to say 3 persons, for. | Excel Worksheet Functions | |||
Password protection | Excel Discussion (Misc queries) |