Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Vlookup 2

Status
Not open for further replies.

rpg121

Programmer
Mar 14, 2001
89
US
I'm new to vba. I'm having trouble doing the vlookup function in vba. Here is the excel cell information. Can anyone help me put this into vba?

Lookup Value = 'Combo Output'!B2
Table Array = 'Scoring Database'!A38:B47
Col Index Num = 2
Range Lookup = 0

 
[tt]

See if this helps

1) Set up ONE Table, where you have ALL your categories together, as follows:

Soda Liquid
Water Liquid
Juice Liquid
Ink Liquid
Bread Solids
Apples Solids
Bananas Solids
Oranges Solids
Paper Solids


2) Assign a Range Name to this table. In the following formula, I've used the name "category".

3) Enter this formula in cell B1...
=VLOOKUP(A1,category,2,FALSE)

Got ASP Error(s)? =
 
I'm not clear on what you mean by "putting it into VBA". Do you want to generate the formula using VBA, or reproduce the result of the VLOOKUP operation using VBA?
Rob
[flowerface]
 
rpg121 -

Try this. First record a macro (Macro1). Enter the VLOOKUP formula you are wanting to code into a cell in the spreadsheet and then stop recording. Edit Macro1 and voila! there's your VBA code.

Hope this helps!
 
I'm being a little teenagerous here, but DUDE!. That is a great tip. I would have almost never thought of that!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top