View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
[email protected] shahzad4u_ksa@yahoo.com is offline
external usenet poster
 
Posts: 68
Default Password to Unhide VeryHidden Sheets

On Jun 4, 3:03*am, Dave Peterson wrote:
Maybe...

Private Sub CommandButton1_Click()
Dim i_pwd As String

i_pwd = InputBox("Please Enter Password to Unhide Sheet", "Unhide Sheet....")
if i_pwd = "" then
* exit sub
end if

Select Case lcase(i_pwd)
* *Case is = "showandy"
* * * * Worksheets("Andy").Visible = True
* * * * Sheets("Andy").Select
* *Case Else
* * * * MsgBox "Incorrect password; no action taken.", vbInformation, _
* * * * * * *"Unhide Sheet..."
End Select

Exit Sub

(Untested, uncompiled.)





ryguy7272 wrote:

Code is not working; must be due to the If...Then. *I'm tired now and can't
see the error in the logic. *Can someone point out the mistake?


Private Sub CommandButton1_Click()
Dim i_pwd As String
Dim pwd As String
'#1
If pwd = "showandy" Then
i_pwd = InputBox("Please Enter Password to Unhide Sheet", "Unhide Sheet...")
Select Case i_pwd
Case pwd
Worksheets("Andy").Visible = True
Sheets("Andy").Select
Case Else
MsgBox "Incorrect password; no action taken.", vbInformation, "Unhide
Sheet..."
End Select
End If
Exit Sub


'#2
If pwd = "showchris" Then
i_pwd = InputBox("Please Enter Password to Unhide Sheet", "Unhide Sheet...")
Select Case i_pwd
Case pwd
Worksheets("Chris").Visible = True
Sheets("Chris").Select
Case Else
MsgBox "Incorrect password; no action taken.", vbInformation, "Unhide
Sheet..."
End Select
End If
Exit Sub


'#3
If pwd = "showdavid" Then
i_pwd = InputBox("Please Enter Password to Unhide Sheet", "Unhide Sheet...")
Select Case i_pwd
Case pwd
Worksheets("David").Visible = True
Sheets("David").Select
Case Else
MsgBox "Incorrect password; no action taken.", vbInformation, "Unhide
Sheet..."
End Select
End If
Exit Sub
End Sub


Regards,
Ryan---


--
RyGuy


--

Dave Peterson- Hide quoted text -

- Show quoted text -




Sorry to jumping in your thread.

your code is working perfect, but when input box is appearing and
asking for password, when you type anything, it is appearing alphabet,
i.e. showandy.

is there any way to change cheractors to ********** (STARIC), so
no one can see what is the password has entered.

Best regards.