+ Reply to Thread
Results 1 to 5 of 5

variable path name based on cell value

  1. #1
    Forum Contributor
    Join Date
    11-18-2008
    Location
    uk
    MS-Off Ver
    Excel 2003 and Excel 2010(sometimes)
    Posts
    139

    variable path name based on cell value

    Hi All

    I want to enter the following formula

    =VLOOKUP(D3,'[172-sep-14.xlsx]Sheet1'!$A$4:$C$34,3,FALSE)

    with 172-sep-14 being a file name

    is it possible to have all or part of the file name as a variable

    Example

    enter a number 172 into cell A3 and for that number to be used in the formula

    =VLOOKUP(D3,'[A3-sep-14.xlsx]Sheet1'!$A$4:$C$34,3,FALSE) somehow for the 172 to be dragged from cell A3

    I hope this makes sense?

  2. #2
    Valued Forum Contributor
    Join Date
    07-07-2014
    Location
    Washington DC
    MS-Off Ver
    2007
    Posts
    1,047

    Re: variable path name based on cell value

    You can fairly easily accomplish this through using the =INDIRECT function (link below). You can create an =INDIRECT function that references a cell where you can input/update/change the name of the file that you want to reference.

    http://office.microsoft.com/en-us/ex...in=HP010342656

  3. #3
    Forum Contributor
    Join Date
    11-18-2008
    Location
    uk
    MS-Off Ver
    Excel 2003 and Excel 2010(sometimes)
    Posts
    139

    Re: variable path name based on cell value

    Thanks

    Sorry but I still have no idea how to use the indirect function

  4. #4
    Valued Forum Contributor
    Join Date
    07-07-2014
    Location
    Washington DC
    MS-Off Ver
    2007
    Posts
    1,047

    Re: variable path name based on cell value

    Here's a template for using a dropdown lookup that relies on the =INDIRECT function. This should help.
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    11-18-2008
    Location
    uk
    MS-Off Ver
    Excel 2003 and Excel 2010(sometimes)
    Posts
    139

    Re: variable path name based on cell value

    Thanks for the example workbook

    Not sure if I have explained things well enough

    I need the following

    I am entering a lookup formula inyo one workbook and for it to lookup the value in separate workbook which will be closed

    The file name of the closed workbook is the value in A3 plus -Sep-14.xlsm
    for example if A3 = 323 then the file name will be
    323-Sep-14.xlsm

    I hope this makes it clearer

    Thanks in advance

+ 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. Email attachment based on path in cell
    By MonkeyDeath in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-03-2014, 02:50 PM
  2. Variable .Attachment.Add path using Function to pull path from word table
    By aavelyn in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-27-2013, 10:07 PM
  3. Replies: 3
    Last Post: 11-21-2012, 03:28 PM
  4. [SOLVED] VBA code to diplay a file path in a cell based on another cell value
    By zhb12810 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-03-2012, 03:24 PM
  5. Replies: 2
    Last Post: 07-24-2012, 11:47 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