borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2008 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Next Topic (How to connect in Excel) New Topic New Poll Post Reply
AndreaVB Forum : VBA (Access, Excel, Word, ...) : Excel Vlookup - table is variable
Poster Message
gosamerone
Level: Big Cheese

Registered: 22-03-2005
Posts: 23

icon Excel Vlookup - table is variable

I have a Excel file "A" where each tab is labeled with a specific product code.
I have another Excel file "B"  that will use a vlookup on Excel file "A", but will need to look across row 1 to determine what tab to look at.
Example
Excel file "A" tab containng table is called 90001

Excel File "B" uses vlookup
=VLOOKUP(A10&C4,'[ExcelfileA.xls]Variable'!$A$2:$F$236,6,0)

I need to look at Excel "B" cell A2 to find the variable. How do I write the variable in this formula?
=VLOOKUP(A10&C4,'[ExcelfileA.xls]&A2&'!$A$2:$F$236,6,0)
is what I tried with no success.

It is a little confusing. I hope I posted this clearly.

07-02-2008 at 08:41 PM
View Profile Send Email to User Show All Posts | Quote Reply
stickleprojects
Level: Moderator


Registered: 09-09-2002
Posts: 1002
icon Re: Excel Vlookup - table is variable

Hi,
Can you post actual values and examples rather than the formulae? I suspect you need to use INDIRECT.
Regards
Kieron


____________________________
Build it better, faster, quicker, easier.. then fix it (non-offical MS mission statement)

08-02-2008 at 02:20 PM
View Profile Send Email to User Show All Posts | Quote Reply
gosamerone
Level: Big Cheese

Registered: 22-03-2005
Posts: 23
icon Re: Excel Vlookup - table is variable

Excel file A contains data to be looked up
Tab names are as follows
90001, 90002, 90003
Tab 90001 represents Product code 90001 and all customer sales data

Excel File B is where I am using the vlookup
A10 - 90001
B10 - 90002
C10 - 90003
Rows contain customer id

A11 = CustA
A12 = Cust B
A13 = Cust C

I need to look up Cust A in the sheet that matches the product code in A10 from Excel file B

08-02-2008 at 03:46 PM
View Profile Send Email to User Show All Posts | Quote Reply
stickleprojects
Level: Moderator


Registered: 09-09-2002
Posts: 1002
icon Re: Excel Vlookup - table is variable

Hi I've attached 2 XLS files that link in a way that should help.
Expand them out to the same folder. You may have to adjust the paths.

Hope this helps
Kieron


____________________________
Build it better, faster, quicker, easier.. then fix it (non-offical MS mission statement)

____________________________
Attached:
excel_links.zip 8 KB (Downloads: 1)

11-02-2008 at 08:56 PM
View Profile Send Email to User Show All Posts | Quote Reply
gosamerone
Level: Big Cheese

Registered: 22-03-2005
Posts: 23
icon Re: Excel Vlookup - table is variable

Thanks, the indirect should help me a few things. I still can't seem to put it all together for this issue though. I am attaching the two files the way I would see them.  Sorry, I should have just attached them from the beginning.

____________________________
Attached:
ExcelB.zip 6 KB (Downloads: 0)

12-02-2008 at 04:30 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : VBA (Access, Excel, Word, ...) : Excel Vlookup - table is variable
Next Topic (How to connect in Excel) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2008 Andrea Tincaniborder