Afternoon,
I have been having issues with loading a password into a userform. And i am wondering where below i am asking the VB to match a value in combobox1 if it can be more than 1 option.
With this i mean i have 30 managers who have 3 people working issues they have. Is there anyway i can write the following
If UserForm2.ComboBox1 = "Manager1", "Manager2", "Manager 3" etc..
If it doesnt match the first set it looks at the next set of names. I think i may need to create a loop for the 3 sets but i am unsure of how to do this.
All help appreciated
Cheers
I have been having issues with loading a password into a userform. And i am wondering where below i am asking the VB to match a value in combobox1 if it can be more than 1 option.
With this i mean i have 30 managers who have 3 people working issues they have. Is there anyway i can write the following
If UserForm2.ComboBox1 = "Manager1", "Manager2", "Manager 3" etc..
If it doesnt match the first set it looks at the next set of names. I think i may need to create a loop for the 3 sets but i am unsure of how to do this.
All help appreciated
Cheers
Code:
Dim gotcha As Boolean
Dim iRow As Long
Dim ws As Worksheet
Dim lRow As Integer
Dim Pword
Dim cell As Range
Dim I As Long
Set myBook = Workbooks.Open(Filename:="C:\Users\MAZZA\Documents\Gavin\Car Park\FYvData.xls") 'Home
Set ws = myBook.Worksheets("Sheet1")
If UserForm2.ComboBox1 = "Laura Haynes" Then
Pword = InputBox("Please enter password")
If Pword = "ticket" Then
ActiveWorkbook.Sheets("Sheet1").Activate
Else
MsgBox "Please contact your administrator for a password"
myBook.Close True
Exit Sub
End If
End If
Unload Me