Solved

“rumtine error 1004”

Posted on 2006-06-12
3
230 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Prevent checkbox click event occur while editing it in vb6 8 74
Visual Studio 2005 text editor 10 54
Excel Automation VBA 19 116
VBA: Insert New column with specific format type 12 56
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…

734 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