ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Tab password to view (https://www.excelbanter.com/excel-discussion-misc-queries/202417-tab-password-view.html)

jackrobyn1

Tab password to view
 
Hi
I am trying to put a password onto a tab so that when i select it, i cant
see it until i enter a password. There is a solution that i have found on
this group but for some reason cant get it to work for me. When i click my
worksheet (Data) it asks for a password..... so far so good, but when i enter
the password it doesnt show me the (data) sheet, just selects another one! Im
not sure where im going wrong. My work sheets are named "Data" "Printable
graphs 1" and "Printable graphs 2" if this helps.... i would like my password
to be "xxx" Thanks in advance.
This is what i tried to adapt and use

Private Const Password As String = "DoubleOhSeven"

Private Sub Worksheet_Activate()
Me.Visible = False
If InputBox("Please Enter the Password for the " _
& Me.Name & " Sheet", "Enter Password") _
< Password Then
Me.Visible = False
Else
Me.Visible = True
End If
End Sub


Mike H

Tab password to view
 
Try this

Private Const Password As String = "DoubleOhSeven"

Private Sub Worksheet_Activate()
Application.EnableEvents = False
Me.Visible = False
If InputBox("Please Enter the Password for the " _
& Me.Name & " Sheet", "Enter Password") < Password Then
Me.Visible = True
Else
Me.Visible = True
Me.Select
End If
Application.EnableEvents = True
End Sub


Mike

"jackrobyn1" wrote:

Hi
I am trying to put a password onto a tab so that when i select it, i cant
see it until i enter a password. There is a solution that i have found on
this group but for some reason cant get it to work for me. When i click my
worksheet (Data) it asks for a password..... so far so good, but when i enter
the password it doesnt show me the (data) sheet, just selects another one! Im
not sure where im going wrong. My work sheets are named "Data" "Printable
graphs 1" and "Printable graphs 2" if this helps.... i would like my password
to be "xxx" Thanks in advance.
This is what i tried to adapt and use

Private Const Password As String = "DoubleOhSeven"

Private Sub Worksheet_Activate()
Me.Visible = False
If InputBox("Please Enter the Password for the " _
& Me.Name & " Sheet", "Enter Password") _
< Password Then
Me.Visible = False
Else
Me.Visible = True
End If
End Sub



All times are GMT +1. The time now is 01:13 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com