Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I used the following code to cause a password prompt to display upon clicking
on a tab in my workbook: Private Sub Worksheet_Activate() Dim strPassword As String On Error Resume Next Me.Protect Password:="123" Me.Columns.Hidden = True strPassword = InputBox("Enter password to view this sheet:") If strPassword = "" Then Me.Previous.Select Exit Sub ElseIf strPassword < "datagility" Then MsgBox "Password Incorrect", , "Wrong password" Me.Previous.Select Exit Sub Else Me.Unprotect Password:="123" Me.Columns.Hidden = True End If On Error GoTo 0 End Sub Private Sub Worksheet_Deactivate() On Error Resume Next Me.Columns.Hidden = True On Error GoTo 0 End Sub **Problem is: when I click on the tab, the sheet is displayed in the background behind the prompt. How can I make it so that it doesn't display at all until the password is successfully entered? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Password Protect | Excel Worksheet Functions | |||
Password Protecting | Excel Discussion (Misc queries) | |||
Sheet Protecting password | Excel Discussion (Misc queries) | |||
password protect .csv file | Excel Discussion (Misc queries) | |||
when I protect my sheet enter tab, & arrow keys dont work... | Excel Discussion (Misc queries) |