View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Dynamic vlookup from a close workbook

The function you'd want to use that's built into excel is =indirect(). But that
function returns an error if the sending workbook is closed.

If that's a problem, then Laurent Longre has an addin (morefunc.xll) at:
http://xcell05.free.fr/
or
http://xcell05.free.fr/morefunc/english/index.htm

That includes =indirect.ext() that may help you.

Dan wrote:

I am trying (very unsuccessfully) to create a vba function that will be like
vlookup but will look in other sheets have 3 argument.
My problem is how to pass the reference to the other sheet to the function

I am aware I can do this without a function:
=VLOOKUP(A1,'C:\Desktop\[test3.xls]Sheet2'!$A$1:$C$18,3,FALSE)
But then if I try to do:
=VLOOKUP(A1,"'C:\Desktop\"&A2,3,FALSE)
A2= [test3.xls]Sheet2'!$A$1:$C$18
It does not work

Any idea?
Dan


--

Dave Peterson