Password protecting certain worksheets in a file

J

JE McGimpsey

If you mean worksheet passwords, one way:

Public Sub ProtectSomeButNotAll()
Const sPWORD As String = "drowwsap"
Dim vSheets As Variant
Dim i As Long
vSheets = Array("Sheet1", "Sheet3", "Sheet5")
For i = LBound(vSheets) To UBound(vSheets)
Worksheets(vSheets(i)).Protect sPWORD
Next i
End Sub
 
Top