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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combine vlookup and MSQuery

Status
Not open for further replies.

Ofina

Technical User
Feb 25, 2004
156
US
I have an SQL database that I have been running select statements on and manually populating a tab of an Excel file. In this Excel file is another tab that does a vlookup on the data manually deposited on the first tab.
That make sense?

I'm trying to automate this. How can I? I know it's possible.

Do I put my SQL statement into an MS Query and then run vlookup off of the results for that? If so, how?
Or is that even more complex than it needs to be?

I need my users to be able to take a long list of items they can deposit on the lookup tab and pull in the appropriate information for each item from a FULLY DYNAMIC data tab.
 
hi,

If you have a query table on one tab, it can be configured to automatically refresh in some manner.

Then you can use a VLOOKUP, if your columns are so configired, using the Table Name associated with the query table.

For instance, I almost always rename my query table something like qMyData. The the lookup might look something like this...
[tt]
=VLOOKUP(a2,qMyData,5,false)
[/tt]


Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top