welshraz
New Member
- Joined
- Apr 29, 2016
- Messages
- 39
- Office Version
- 365
- Platform
- Windows
Hello again,
I have password protected a tab using the following:
Sub OpenWS()
Dim S As String
S = InputBox("Enter Password")
If S = vbNullString Then
Exit Sub
ElseIf S <> "teamlongdrop" Then
Exit Sub
Else
Worksheets("Contacts").Visible = xlSheetVisible
Sheets("Contacts").Select
End If
End Sub
I have linked this to a button but it asks for the password every time it is pressed. Is there a way of making it so that it only asks for the password if the tab is still hidden? Essentially, I want it to ask for a password the first time the button is pressed after the workbook is opened, but after that point it for it to just take you to the "Contacts" tab?
I have password protected a tab using the following:
Sub OpenWS()
Dim S As String
S = InputBox("Enter Password")
If S = vbNullString Then
Exit Sub
ElseIf S <> "teamlongdrop" Then
Exit Sub
Else
Worksheets("Contacts").Visible = xlSheetVisible
Sheets("Contacts").Select
End If
End Sub
I have linked this to a button but it asks for the password every time it is pressed. Is there a way of making it so that it only asks for the password if the tab is still hidden? Essentially, I want it to ask for a password the first time the button is pressed after the workbook is opened, but after that point it for it to just take you to the "Contacts" tab?