I have a basic 2 button userform and 4 worksheets.
Button 1 is for all users
Button 2 is for admin only
When selecting button 2 I need all hidden worksheets to become visible, which they are doing... but i need this to happen with a password prompt. If it is incorrect, try again or cancel (the user can then manually exit or use button 1)
I have used the following:
Right now, the password prompt works, but even if you enter an incorrect password it unhides all 3 sheets. Also, if you click Cancel that also unhides all 3 sheets.
Please help!
Button 1 is for all users
Button 2 is for admin only
When selecting button 2 I need all hidden worksheets to become visible, which they are doing... but i need this to happen with a password prompt. If it is incorrect, try again or cancel (the user can then manually exit or use button 1)
I have used the following:
VBA Code:
With sheets("Admin")
With sheets("Cases")
With sheets ("Other")
.visible = IIf(InputBox("Enter Password") = "Password", xlsheetvisible, xlsheetveryhidden)
If .visible = xlsheetveryhidden Then msgbox "Incorrect Password. Try again."
End with
End with
End with
Right now, the password prompt works, but even if you enter an incorrect password it unhides all 3 sheets. Also, if you click Cancel that also unhides all 3 sheets.
Please help!