+ Reply to Thread
Results 1 to 4 of 4

Using a parameter in a path to another file

  1. #1
    Forum Contributor
    Join Date
    05-28-2010
    Location
    Antwerp, Belgium
    MS-Off Ver
    Office 365
    Posts
    170

    Using a parameter in a path to another file

    I have the following formula referring to the file [MARKING 116E.xlsm]:

    =VLOOKUP($C3;'[MARKING 116E.xlsm]YIELD'!$C$3:$I$4000;3)

    I would like that '116E' will not be a fixed value, but will be taken from the cell A1.

    Thanks

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,418

    Re: Using a parameter in a path to another file

    You would normally use the INDIRECT function to do that, but INDIRECT will only work with open files, and I suspect that will not be the case here.

    Pete

  3. #3
    Forum Contributor
    Join Date
    05-28-2010
    Location
    Antwerp, Belgium
    MS-Off Ver
    Office 365
    Posts
    170

    Re: Using a parameter in a path to another file

    Quote Originally Posted by Pete_UK View Post
    You would normally use the INDIRECT function to do that, but INDIRECT will only work with open files, and I suspect that will not be the case here.

    Pete
    No, it's ok, it can be open.

    Can you please integrate the INDIRECT in this formula? I can't find the syntax.
    Thanks!

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,418

    Re: Using a parameter in a path to another file

    Okay, try it this way:

    =VLOOKUP($C3;INDIRECT("'[MARKING "&$A$1&".xlsm]YIELD'!$C$3:$I$4000");3)

    (changes in red), where "116E" (without the quotes) is in A1.

    Hope this helps.

    Pete

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. copy file from path to path
    By rudyHanna in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-26-2017, 09:15 AM
  2. [SOLVED] Separate complete path to file and directory path
    By drgkt in forum Excel General
    Replies: 19
    Last Post: 10-28-2016, 04:17 PM
  3. Choosing folder path (instead of file path) in VBA
    By sminter in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-23-2014, 08:50 PM
  4. Replies: 0
    Last Post: 01-27-2013, 12:13 PM
  5. Specified folder path to select file path
    By JayEmTee91 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-29-2012, 10:38 AM
  6. Replies: 7
    Last Post: 10-09-2009, 10:10 AM
  7. Use String Variables in File Path and create path if not existing
    By JanBang in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-26-2007, 09:04 AM

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