Unprotect

  • Thread starter Thread starter Noepie
  • Start date Start date
N

Noepie

Hello,

I have a document with three sheets. One of them is hidden (standard
situation). I would like to create a button in one of the other sheets to
automatically change the property of the hidden sheet to visible when I push
the button. But the change to visible should be confirmed by a password which
is preset. If an incorrect password is entered the property of the sheet
remainds hidden. How can I achieve this?

Thanx in advance.

Noepie
 
Sub unhide_sht1()
pword = InputBox("Enter the password")
If pword = "qwert" Then
Sheets("Sheet1").Visible = True
Else
MsgBox "Incorrect Password"
End If
End Sub

Note: Sheet1 should be set to xlveryhidden or users can unhide simply by
Format>Sheet>Unhide

Lock the code from view by setting ProjectProperties to locked.


Gord Dibben MS Excel MVP
 
Back
Top