+ Reply to Thread
Results 1 to 4 of 4

Lookup file with relative pathname

  1. #1
    Hall
    Guest

    Lookup file with relative pathname

    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?



  2. #2
    Ian
    Guest

    Re: Lookup file with relative pathname

    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

    --
    Ian
    --
    "Hall" <[email protected]> wrote in message
    news:[email protected]...
    > 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?
    >
    >




  3. #3
    Hall
    Guest

    Re: Lookup file with relative pathname

    I'm not aware of any such function or construct.

    "Ian" <[email protected]> wrote in message
    news:[email protected]...
    > 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
    >
    > --
    > Ian
    > --
    > "Hall" <[email protected]> wrote in message
    > news:[email protected]...
    > > 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?
    > >
    > >

    >
    >




  4. #4
    Ian
    Guest

    Re: Lookup file with relative pathname

    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.

    --
    Ian
    --
    "Hall" <[email protected]> wrote in message
    news:[email protected]...
    > I'm not aware of any such function or construct.
    >
    > "Ian" <[email protected]> wrote in message
    > news:[email protected]...
    >> 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
    >>
    >> --
    >> Ian
    >> --
    >> "Hall" <[email protected]> wrote in message
    >> news:[email protected]...
    >> > 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?
    >> >
    >> >

    >>
    >>

    >
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1