Solved

“rumtine error 1004”

Posted on 2006-06-12
3
225 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VB6 code to programmatically convert pdf to excel 21 92
Updates not working for MS Windows 7 12 166
Hide vba in gp 7 95
Passing a Text Box name to a Sub 6 96
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

777 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