Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Password dialogue box to protect an excel worksheet 1

Status
Not open for further replies.

nickkeyes

Programmer
Jun 19, 2003
4
GB
I have a large, shared worksheet and require different views of the system for various users. I need to create a macro to open a dialogue box requesting this password which after successful entry the user clicks ok and a worksheet is displayed. I'm using a separate worksheet at the moment to create a conditional hyperlink to the desired page, but it doesn't look very professional. Any ideas???
I also need a macro to change the password.
 
This will let you get the password from your user.

In the on open event of your workbook add this code:
Private Sub Workbook_Open()
Pword = InputBox("Enter Password", "Security")
'In this area put what you want to check
if pword="12345" then
sheets("Sheet2").visible=true
end if
End Sub

HTH,
Eric
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top