LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Password Userform Help Please

I have a workbook with multiple sheets. I want departments to view the
sheets applicable to that department. I have set up the hide and views but
wanted the 'trigger' to be a password entered in a password userform. My
userform code below but it will not work and I can't work our why. Any ideas?


Public PsWdAnswer As String
'Password for All Sheets
Private Const PsWd2 As String = "A"
'Password for Admin
Private Const PsWd3 As String = "B"
'Password for Operations
Private Const PsWd4 As String = "C"
'Password for Consult
Private Const PsWd5 As String = "D"
'Password for Marketing
Private Const PsWd6 As String = "E"

Private Sub Cancel2_Click()

Call Password1Exit

End Sub

Private Sub OKButton2_Click()

If PsWdAnswer = PsWd2 Then
Call Unhide_All
ElseIf PsWdAnswer = PsWd3 Then
Call Admin
ElseIf PsWdAnswer = PsWd4 Then
Call Operations
ElseIf PsWdAnswer = PsWd5 Then
Call Consult
ElseIf PsWdAnswer = PsWd6 Then
Call Marketing
Else: Call Password1Exit
End If
End Sub

Private Sub PsWd_Change()


End Sub
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Password Userform Freshman Excel Worksheet Functions 1 January 20th 10 12:44 PM
UserForm Password Ola2B Excel Discussion (Misc queries) 1 February 28th 07 02:25 PM
password userform K1KKKA Excel Programming 2 January 10th 07 03:52 PM
Password Userform help !!!! K1KKKA Excel Discussion (Misc queries) 4 January 10th 07 03:09 PM
password userform Roland Excel Programming 1 December 10th 04 08:50 PM


All times are GMT +1. The time now is 03:17 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"