Hi,
I have a userform with combobox6 on it which has two options Full and Part based on what is selected I want to update a textbox using vlookup the issue I am having is that the vlookup range is different dependent on the selection from the combobox, I have tried the below but I cannot get it to work. any help would be appreciated.
Combobox3 if the vlookup value this is also on the userform
I have a userform with combobox6 on it which has two options Full and Part based on what is selected I want to update a textbox using vlookup the issue I am having is that the vlookup range is different dependent on the selection from the combobox, I have tried the below but I cannot get it to work. any help would be appreciated.
Combobox3 if the vlookup value this is also on the userform
VBA Code:
Private Sub ComboBox6_Change()
If ComboBox6 = "Full" Then
TextBox2.Value = Application.VLookup(Me.ComboBox3.Value, Sheets("Absence Totals").Range("a:g"), 7, 0)
ElseIf ComboBox6 = "part" Then
TextBox2.Value = Application.VLookup(Me.ComboBox3.Value, Sheets("Absence Totals").Range("a:h"), 8, 0)
Else
End If
End Sub