I have a userform that has comboboxes that lookup a value in a table to populate a textbox on the same userform. The code is working. It produces the desired results and the form data saves accurately to the table, however instead of getting my MsgBox "Saved", I get error 1004 'Unable to get the VLookup property of the worksheet function class.'
When I debug the line highlighted is Me.men10.Value = Application.WorksheetFunction.VLookup(rec1, rRange, 47, 0)
This is the sub procedure in it's entirety:
Private Sub men8_Change()
Dim rec1 As String
Dim rRange As Range
Set rRange = Sheets("Recipe Box").Range("tblRecipes")
rec1 = Me.men8.Value
Me.men10.Value = Application.WorksheetFunction.VLookup(rec1, rRange, 47, 0)
End Sub
I have four of these on the form and as I said, everything works as it should but still results in the error. Any suggestions? I have searched everywhere but can't find anything related to errors on working code.
Here is a snippet of the form controls: The circled textbox (men10) is populated from the combobox (men8) above it.
