Link to home
Start Free TrialLog in
Avatar of ca1358
ca1358

asked on

“rumtine error 1004”

I am adding this piece of code to this sub.  I have three combo boxes, the second and third  is dependant on the first one.  After you pick you choice in the second one, I need to go do a vlookup but I could this error.  

“rumtine error 1004”
“Unable to get the vlookup property of the Worksheet Function class”

I tried this piece just on one combo box and it works.  

Any help would be appreciated!



Worksheets("Sheet22").Range("R20") = WorksheetFunction.VLookup(cboSecondary.Value, Sheets("data").Range("B3:G6"), 15, False)
End Sub
////////////////////////////////////////////////////////////


Private Sub cboSecondary_Change()
Dim mysheet As Worksheet
Set mysheet = ActiveSheet


Application.EnableEvents = False
mysheet.Unprotect
Sheet22.Range("x28:x57") = cboSecondary.Value 'Copy Delivery Date Column X
Application.EnableEvents = True

Worksheets("Sheet22").Range("R20") = WorksheetFunction.VLookup(cboSecondary.Value, Sheets("data").Range("B3:G6"), 15, False)
End Sub
ASKER CERTIFIED SOLUTION
Avatar of mvidas
mvidas
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ca1358
ca1358

ASKER

Thank you!
Glad to help! Please let me know if you need anything else