Good Afternoon,
I use a userform to identify The page "Ashley Longman" that the information is held in which is working fine. I have been asked to add another criteria into the mix. I now need to only load the userform for a specific manager. I have added another combox to the userform that loads this but am unsure of how to tie it into the VB. The managers name would be in column B (i, 2) so i need it to search for the name in the column then check if there is anything open in column 14.
I apologise if the VB isnt showing as stepped but it was when i copied it in.
Many Thanks
Gavin
I use a userform to identify The page "Ashley Longman" that the information is held in which is working fine. I have been asked to add another criteria into the mix. I now need to only load the userform for a specific manager. I have added another combox to the userform that loads this but am unsure of how to tie it into the VB. The managers name would be in column B (i, 2) so i need it to search for the name in the column then check if there is anything open in column 14.
I apologise if the VB isnt showing as stepped but it was when i copied it in.
Many Thanks
Gavin
Code:
Dim iRow As Long
Dim ws As Worksheet
Dim lRow As Long
Set ws = Worksheets("Ashley Longman")
If UserForm2.ComboBox1 = "Ashley Longman" Then
Pword = InputBox("Please enter password")
If Pword = "ticket" Then
ActiveWorkbook.Sheets("Ashley Longman").Activate
Else
MsgBox "Please contact your system provider for a password"
Exit Sub
End If
Unload Me
lRow = Range("N" & Rows.Count).End(xlUp).Row + 1
For i = 3 To lRow
If Cells(i, 1).Value = "" Then Exit For
If Cells(i, 1).Value <> "" And Cells(i, 14).Value = "" Then
gotcha = True
UserForm1.Show False
UserForm1.txtdate.Value = Cells(i, 1)
UserForm1.TextBox1.Value = Cells(i, 3)
UserForm1.TextBox13.Value = Cells(i, 2)
UserForm1.TextBox2.Value = Cells(i, 4)
UserForm1.TextBox3.Value = Cells(i, 7)
UserForm1.TextBox6.Value = Cells(i, 5)
UserForm1.TextBox5.Value = Cells(i, 6)
UserForm1.TextBox4.Value = Cells(i, 8)
UserForm1.TextBox7.Value = Cells(i, 9)
UserForm1.TextBox8.Value = Cells(i, 10)
UserForm1.TextBox9.Value = Cells(i, 13)
UserForm1.TextBox14.Value = Cells(i, 11)
UserForm1.TextBox15.Value = Cells(i, 12)
UserForm1.TextBox11.Value = Cells(i, 4)
With UserForm1.CBoxAdd
.AddItem "Ash Young"
.AddItem "Chris Holcombe"
.AddItem "Chris Nash"
.AddItem "David Watson"
.AddItem "Gary Littler"
.AddItem "Kris Harwood"
.AddItem "Michelle Porter"
.AddItem "Tim Nickson"
.AddItem "Zenny Asghar"
End With
With UserForm1.txtdate
.Enabled = False
End With
End If
Next
If gotcha = False Then
MsgBox "Nothing to Update"
ActiveWindow.Close (True)
End If