Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 92
Default External Reference in Vlookup

Hi Guys:

I would like to do a vlookup from an external reference. I've done this many
times where the file name of the external reference is known at the time of
developing the macro. This time, the file name will vary from instance to
instance, but the internal structure of the file will be identical and I can
insist that the user keeps the file in the same location as this
spreadsheet.
My first attempt was to develop the vlookup formula on-the-fly using a cell
where the user input the external reference file name. While this worked the
first time, it failed the repeat test.
This sounds like it should be fairly simple, but the procedure excapes me.

Any thoughts,

Craig


  #2   Report Post  
Posted to microsoft.public.excel.misc
bj bj is offline
external usenet poster
 
Posts: 1,397
Default External Reference in Vlookup

in what way did the external reference fail?
The indirect function should work in the reference area
additionally
a cell which will be used to gather the external reference could be used as
the reference for the lookup, it would also be easy to see if the reference
came in properly.

"C Brandt" wrote:

Hi Guys:

I would like to do a vlookup from an external reference. I've done this many
times where the file name of the external reference is known at the time of
developing the macro. This time, the file name will vary from instance to
instance, but the internal structure of the file will be identical and I can
insist that the user keeps the file in the same location as this
spreadsheet.
My first attempt was to develop the vlookup formula on-the-fly using a cell
where the user input the external reference file name. While this worked the
first time, it failed the repeat test.
This sounds like it should be fairly simple, but the procedure excapes me.

Any thoughts,

Craig



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 92
Default External Reference in Vlookup

The code was generated some time ago and I'm not sure exactly how I did it,
but the code froze on the target file and never changed when the user chaged
the cell holding the target filename. Big opps.
Can you give me an example of the indirect method that will apply?

Craig

"bj" wrote in message
...
in what way did the external reference fail?
The indirect function should work in the reference area
additionally
a cell which will be used to gather the external reference could be used

as
the reference for the lookup, it would also be easy to see if the

reference
came in properly.

"C Brandt" wrote:

Hi Guys:

I would like to do a vlookup from an external reference. I've done this

many
times where the file name of the external reference is known at the time

of
developing the macro. This time, the file name will vary from instance

to
instance, but the internal structure of the file will be identical and I

can
insist that the user keeps the file in the same location as this
spreadsheet.
My first attempt was to develop the vlookup formula on-the-fly using a

cell
where the user input the external reference file name. While this worked

the
first time, it failed the repeat test.
This sounds like it should be fairly simple, but the procedure excapes

me.

Any thoughts,

Craig





  #4   Report Post  
Posted to microsoft.public.excel.misc
bj bj is offline
external usenet poster
 
Posts: 1,397
Default External Reference in Vlookup


if, for example you want to lookup in the range A1:G20 in a worksheet in
different books
put the name of the workbookin a cell (A1?)
put the name of the worksheet in a Cell (B1?)

=vlookup(Lookup_reference,offset(indirect("'["&A1&"]"&B1&"'!A1"),0,0,20,8),ref_column,0)

"C Brandt" wrote:

The code was generated some time ago and I'm not sure exactly how I did it,
but the code froze on the target file and never changed when the user chaged
the cell holding the target filename. Big opps.
Can you give me an example of the indirect method that will apply?

Craig

"bj" wrote in message
...
in what way did the external reference fail?
The indirect function should work in the reference area
additionally
a cell which will be used to gather the external reference could be used

as
the reference for the lookup, it would also be easy to see if the

reference
came in properly.

"C Brandt" wrote:

Hi Guys:

I would like to do a vlookup from an external reference. I've done this

many
times where the file name of the external reference is known at the time

of
developing the macro. This time, the file name will vary from instance

to
instance, but the internal structure of the file will be identical and I

can
insist that the user keeps the file in the same location as this
spreadsheet.
My first attempt was to develop the vlookup formula on-the-fly using a

cell
where the user input the external reference file name. While this worked

the
first time, it failed the repeat test.
This sounds like it should be fairly simple, but the procedure excapes

me.

Any thoughts,

Craig






  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 92
Default External Reference in Vlookup

bj:

I seem to be missing something: What is the "Offset" portion of the formula
all about?

Here is the formula that I am trying to generate:
=VLOOKUP($H12,'[Trades Sheet - 6-28-07.xls]Buy'!$A$13:$BV$500,70,0) '
This works.

Cell I4 is equal to the filename ( Trades Sheet - 6-28-07a.xls )
Cell I5 is equal to the range ( Buy'!$A$13:$BV$500 ) ' I could build the
range into the formula since it shouldn't change.
But, looking at your example and with a little work on my part, I figured
the new formula should look like this:
=VLOOKUP($H12,indirect("'["&$I$4&"]"&$I$5),70,0)
I will populate the rest of the row with this, then copy and paste-value
over the formulas to lock the data into place.
Unfortunately, this formula gives me a #REF! error.

Any ideas?

Thanks for your help. I'm way over my head and without this type of help I
would unquestionably drown,
Craig

"bj" wrote in message
...

if, for example you want to lookup in the range A1:G20 in a worksheet in
different books
put the name of the workbookin a cell (A1?)
put the name of the worksheet in a Cell (B1?)


=vlookup(Lookup_reference,offset(indirect("'["&A1&"]"&B1&"'!A1"),0,0,20,8),r
ef_column,0)

"C Brandt" wrote:

The code was generated some time ago and I'm not sure exactly how I did

it,
but the code froze on the target file and never changed when the user

chaged
the cell holding the target filename. Big opps.
Can you give me an example of the indirect method that will apply?

Craig

"bj" wrote in message
...
in what way did the external reference fail?
The indirect function should work in the reference area
additionally
a cell which will be used to gather the external reference could be

used
as
the reference for the lookup, it would also be easy to see if the

reference
came in properly.

"C Brandt" wrote:

Hi Guys:

I would like to do a vlookup from an external reference. I've done

this
many
times where the file name of the external reference is known at the

time
of
developing the macro. This time, the file name will vary from

instance
to
instance, but the internal structure of the file will be identical

and I
can
insist that the user keeps the file in the same location as this
spreadsheet.
My first attempt was to develop the vlookup formula on-the-fly using

a
cell
where the user input the external reference file name. While this

worked
the
first time, it failed the repeat test.
This sounds like it should be fairly simple, but the procedure

excapes
me.

Any thoughts,

Craig








Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
input for external reference kspurgin Excel Discussion (Misc queries) 1 August 15th 06 05:41 PM
sumproduct external reference#2 anand Excel Worksheet Functions 5 May 23rd 05 11:36 PM
sumproduct external reference anand Excel Worksheet Functions 2 May 23rd 05 11:23 PM
External Reference Iain Excel Discussion (Misc queries) 3 February 8th 05 06:53 PM
External reference as a condition Ingeniero1 Excel Worksheet Functions 2 November 12th 04 07:10 PM


All times are GMT +1. The time now is 03:13 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"