I have added this Vlookup code per a Combobox change.
When in the form it works exactly the way I want it too. I make a change in the combobox and Textbox18 updates to correct horsepower rating. When I click to have the data entered into the spreadsheet it fails on this vlookup command. I don't understand why or a solution to resolve it. I am not having any of the data in the textbox written its just a visual for the user to know what HP rating they are getting per the selection.
Here is the full combobox code:
Thanks,
Scott
Code:
TextBox18.Value = Application.WorksheetFunction.VLookup(TextBox2, Sheet2.Range("H7:L47"), 3, False)
TextBox19.Value = Application.WorksheetFunction.VLookup(TextBox2, Sheet2.Range("H7:L47"), 2, False)
When in the form it works exactly the way I want it too. I make a change in the combobox and Textbox18 updates to correct horsepower rating. When I click to have the data entered into the spreadsheet it fails on this vlookup command. I don't understand why or a solution to resolve it. I am not having any of the data in the textbox written its just a visual for the user to know what HP rating they are getting per the selection.
Here is the full combobox code:
Code:
Private Sub ComboBox2_Change()
With Me
.ComboBox13.ListIndex = -1 = .ComboBox2.ListIndex <> -1
End With
'Engine P/N
y = ComboBox2.Text
TextBox2.Value = y
TextBox18.Value = Application.WorksheetFunction.VLookup(TextBox2, Sheet2.Range("H7:L47"), 3, False)
TextBox19.Value = Application.WorksheetFunction.VLookup(TextBox2, Sheet2.Range("H7:L47"), 2, False)
End Sub
Thanks,
Scott