View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.newusers
Robert McCurdy Robert McCurdy is offline
external usenet poster
 
Posts: 102
Default How to set password for multiple worksheet and to hide ?

Ok, you are going to write down all your passwords first?

Sub ProtectAllSheets()
Dim wks As Worksheet, Pswd As String
Pswd = "mypassword" 'change to your one
For Each wks In ActiveWorkbook.Worksheets
wks.Protect Password:=Pswd & wks.Index
Next wks
End Sub

To Unprotect:

Sub UnProtectAllSheets()
Dim wks As Worksheet, Pswd As String
Pswd = "mypassword" 'use your password
For Each wks In ActiveWorkbook.Worksheets
wks.Unprotect Password:=Pswd & wks.Index
Next wks
End Sub


Paste these 2 into a new code module (Alt + F11 and insert module)
Then to run them Alt + F8 will show them, under Options there you can create a short cut key combination.

Regards
Robert McCurdy
"Mah" wrote in message ...
How am I to set different password for different worksheet ? This to allow
certain person to see only certain worksheet when clicking on one password
"123". I'm new Macro. Your guidance please