How do I hide and password protect a sheet without hardcoding the password?
I've searched the forums and can't find an example where passwords are not hard-coded, hence this new thread.
I have 11 sheets in my workbook, a summary sheet (visible) and 10 input sheets (xlveryhidden and require a password to open using an Input Box). The passwords for the 10 hidden sheets are currently hard-coded, but, I need to let a novice excel user who is an admin user of the workbook determine the the passwords. I have added a sheet called "Login". This sheet contains a list of sheet names and corresponding passwords, I plan to make the "Login" sheet xlveryhidden and add code to a button on the summary sheet that will unhide the "Login" sheet for the admin user. The summary sheet will also contain buttons with code to access each of the 10 input sheets - for example....
Private Sub UnhideSheet()
pword = InputBox("Please Enter a Password", "Unhide Sheet")
If pword <> "password" Then ActiveSheet.Visible = False
End Sub
Does anyone have advice as to how I change this example code so it refers to the cell containing the password on the "Login" sheet?
I'm open to other suggestions on how I can achieve my goal.
Thank you in advance for any assistance you can provide.
I've searched the forums and can't find an example where passwords are not hard-coded, hence this new thread.
I have 11 sheets in my workbook, a summary sheet (visible) and 10 input sheets (xlveryhidden and require a password to open using an Input Box). The passwords for the 10 hidden sheets are currently hard-coded, but, I need to let a novice excel user who is an admin user of the workbook determine the the passwords. I have added a sheet called "Login". This sheet contains a list of sheet names and corresponding passwords, I plan to make the "Login" sheet xlveryhidden and add code to a button on the summary sheet that will unhide the "Login" sheet for the admin user. The summary sheet will also contain buttons with code to access each of the 10 input sheets - for example....
Private Sub UnhideSheet()
pword = InputBox("Please Enter a Password", "Unhide Sheet")
If pword <> "password" Then ActiveSheet.Visible = False
End Sub
Does anyone have advice as to how I change this example code so it refers to the cell containing the password on the "Login" sheet?
I'm open to other suggestions on how I can achieve my goal.
Thank you in advance for any assistance you can provide.