ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   vlookup file specification (https://www.excelbanter.com/excel-worksheet-functions/25163-vlookup-file-specification.html)

h2olawrence

vlookup file specification
 
can i reference a file location in a separate cell for vlookup? i have a
whole column of numbers that come from different files, but they tend to move
around to different folders quite a bit. plus, if it works, i'd like to use
it as a template. however, i don't want to have to change every cell's
lookup. if i could just have the file location and name in a cell somewhere
and change that one spot instead of individual formulas, it'd be great. it
seems like something that should be so easy!

paul

do you mean the target table of the vlookup would change folders all the
time??You could have a cell or formulas that recorded the filename or path
and filename of your worksheets but that would have to updated manually via
the edit- links menu.Even then i am not sure you could put those paths into
a vlookup...if you did that the links in the vlookup formulas could be kept
updated too....
--
hope this helps
Paul


"h2olawrence" wrote:

can i reference a file location in a separate cell for vlookup? i have a
whole column of numbers that come from different files, but they tend to move
around to different folders quite a bit. plus, if it works, i'd like to use
it as a template. however, i don't want to have to change every cell's
lookup. if i could just have the file location and name in a cell somewhere
and change that one spot instead of individual formulas, it'd be great. it
seems like something that should be so easy!


Ragdyer

Try this, with lookup value in A1 and sheet name in A2:

=VLOOKUP(A1,INDIRECT(A2&"!A1:B15"),2,0)
--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------

"h2olawrence" wrote in message
...
can i reference a file location in a separate cell for vlookup? i have a
whole column of numbers that come from different files, but they tend to

move
around to different folders quite a bit. plus, if it works, i'd like to

use
it as a template. however, i don't want to have to change every cell's
lookup. if i could just have the file location and name in a cell

somewhere
and change that one spot instead of individual formulas, it'd be great. it
seems like something that should be so easy!



Andy Wiggins

Yes, but only if the file, you want to reference, is open.

This workbook demonstrates how to get data direct from an MS Access table,
or from an open or closed MS Excel workbook using the workbook function
SQL.REQUEST.
http://www.bygsoftware.com/examples/...SqlRequest.zip

It's in the "Excel with Access Databases" section on page:
http://www.bygsoftware.com/examples/examples.htm

Recently updated to show the use of SQL.REQUEST in the same workbook.

The code is open and commented.


--
Regards
-
Andy Wiggins FCCA
www.BygSoftware.com
Excel, Access and VBA Consultancy


"h2olawrence" wrote in message
...
can i reference a file location in a separate cell for vlookup? i have a
whole column of numbers that come from different files, but they tend to

move
around to different folders quite a bit. plus, if it works, i'd like to

use
it as a template. however, i don't want to have to change every cell's
lookup. if i could just have the file location and name in a cell

somewhere
and change that one spot instead of individual formulas, it'd be great. it
seems like something that should be so easy!





All times are GMT +1. The time now is 05:55 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com