T
Topher
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
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