password prompt to unhide sheet

  • Thread starter Thread starter Jeff
  • Start date Start date
J

Jeff

Scenario:

I have a a button that when pressed unhides Sheet X. What
I would like to do is actually require a password prompt
when that button is pressed; thereby requiring that the
user know the password before accessing that particular
hidden sheet. Is this possible, and if so, what would the
VBA code look like?
 
Sure

Sub tester()
Dim S As String
S = InputBox("Password:")
Select Case S
Case ""
Case "*****"
Sheets(1).Visible = True
Case Else
MsgBox "Wrong password.", vbInformation
End Select
End Sub


HTH. Best wishes Harald
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top