password on a tab

J

jackrobyn1

How do i put a password on a sheet tab so that when someone clicks the tab a
message box appears and asks for a password, if the correct word is put in
they are straight into the sheet and can work/ alter the data, if not they
cant see it.
ps my sheet is called Fleet List and my password needs to be "jack"

Thanks
 
O

Otto Moehrbach

You can use a Worksheet_Activate event macro. When the user clicks on the
sheet tab, the macro fires. You can write into the macro whatever you want
to happen. Maybe something like:
Private Sub Worksheet_Activate()
Dim Ans As String
Sheets("DummySheet").Select
Ans = InputBox("Please enter password.")
If Ans = "Jack" Then
Application.EnableEvents = False
Sheets("Fleet List").Select
Application.EnableEvents = True
End If
End Sub
DummySheet is whatever sheet you want to display if he enters the wrong
password.
 

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

Top