Morning everyone
I have got the code which perfectly working. combobox1 finds the staff number and then populates names in Combobox 1 & 5 however i would like to change this from a staff number to names find
below is the code whereby it finds it using the staff number. the staff number is in column A & names in column B
I have got the code which perfectly working. combobox1 finds the staff number and then populates names in Combobox 1 & 5 however i would like to change this from a staff number to names find
below is the code whereby it finds it using the staff number. the staff number is in column A & names in column B
VBA Code:
Private Sub ComboBox1_Change()
If Me.ComboBox1.Value <> "" Then
Me.TextBox1.Value = Application.WorksheetFunction.VLookup(CLng(Me.ComboBox1.Value), ThisWorkbook.Sheets("Monthly Summary").Range("A:B"), 2, 0)
Me.TextBox6.Value = Application.WorksheetFunction.VLookup(CLng(Me.ComboBox1.Value), ThisWorkbook.Sheets("Monthly Summary").Range("A:C"), 3, 0)
Else
Me.TextBox1.Value = ""
End If
End Sub