Lookup file with relative pathname

  • Thread starter Thread starter Hall
  • Start date Start date
H

Hall

My formulas such as VLOOKUP refer to cells in other workbook files.

Excel automatically uses the "hardcoded" absolute pathnames to these files.
I need to use a relative pathname so that the set of workbooks are portable.

For example, where I currently have
vlookup(A1,'N:\Groupname\projectA\workbook.xls'!B1:B10,1)

I want
vlookup(A1,'..\workbook.xls'!B1:B10,1)

Is this possible?
 
Can you use something like the Path property to retrieve the full path of
the current workbook then use this to construct the hard-coded pathname? I'm
not sure how to create the pathname within the vlookup argument, but this
may be a starting point for you.

eg fullpath = Workbooks("book1.xls").Path
 
I'm not aware of any such function or construct.

Ian said:
Can you use something like the Path property to retrieve the full path of
the current workbook then use this to construct the hard-coded pathname? I'm
not sure how to create the pathname within the vlookup argument, but this
may be a starting point for you.

eg fullpath = Workbooks("book1.xls").Path
 
I'm sorry. I misread your OP. The function I am referring to is in VBA. You
would need to write code to use this option. I don't know of any way to do
this with a formula.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top