Solved

“rumtine error 1004”

Posted on 2006-06-12
3
220 Views
Last Modified: 2008-03-04
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
0
Comment
Question by:ca1358
  • 2
3 Comments
 
LVL 35

Accepted Solution

by:
mvidas earned 500 total points
ID: 16887379
Hi ca1358,

Your vlookup formula is requesting to return the 15th column in the lookup range, but the lookup range is only B3:G6 which is only 6 columns wide.  Thats why the error is occurring, what column are you looking to return from the "Data" sheet?

Matt
0
 

Author Comment

by:ca1358
ID: 16887871
Thank you!
0
 
LVL 35

Expert Comment

by:mvidas
ID: 16887900
Glad to help! Please let me know if you need anything else
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now