• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Protecting Sheets with Multiple Passwords

sridhar_shri03

New Member
Hi All,

I have different sheets in my workbook for which i have different passwords with which i need to protect each sheet with the password assigned to it.

Is it possible to do a macro which automatically protect the sheets with the correct password

I have attached a sample workbook the sheet "passwords" will have sheet names in first column and respective passwords in the second column

Please revert back for any clarifications & help would be much appreciated.

Thanks
Sridhar_shri03
 

Attachments

  • Protect Password.xlsx
    8.5 KB · Views: 3
Try the following code

Code:
Sub Protect_sheets()

  Sheets("BNY").Protect "BNY12", DrawingObjects:=True, Contents:=True, Scenarios:=True
  Sheets("Mellon").Protect "54Mell", DrawingObjects:=True, Contents:=True, Scenarios:=True
  Sheets("GD").Protect "78GD", DrawingObjects:=True, Contents:=True, Scenarios:=True
   
End Sub
 
Back
Top