+ Reply to Thread
Results 1 to 6 of 6

Partial file name from cell

  1. #1
    Forum Contributor
    Join Date
    05-30-2015
    Location
    Dubai
    MS-Off Ver
    Excel 2016 Mac & PC & 365
    Posts
    633

    Partial file name from cell

    Hi,

    I am using the following formula and would like to modify it so that part of the path comes from a cell reference

    Please Login or Register  to view this content.
    I would like to get 1955 from a cell reference

    Any help greatly appreciated
    Kevin

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,369

    Re: Partial file name from cell

    Maybe:

    =SUMPRODUCT(INDIRECT("'C:\Test\[1955_2020.xlsx]Data'!$Z$2:$Z$10601,--('C:\Test\["&A1&"_2020.xlsx]Data'!$U$2:$U$10601")=$H$4))
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Contributor
    Join Date
    05-30-2015
    Location
    Dubai
    MS-Off Ver
    Excel 2016 Mac & PC & 365
    Posts
    633

    Re: Partial file name from cell

    Thank you for your quick response Ali,

    If I want both 1955 to reference the cell, how do I write the formula ?

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,369

    Re: Partial file name from cell

    Missed that - sorry!

    =SUMPRODUCT(INDIRECT("'C:\Test\["&A1&"_2020.xlsx]Data'!$Z$2:$Z$10601,--('C:\Test\["&A1&"_2020.xlsx]Data'!$U$2:$U$10601")=$H$4))

  5. #5
    Forum Contributor
    Join Date
    05-30-2015
    Location
    Dubai
    MS-Off Ver
    Excel 2016 Mac & PC & 365
    Posts
    633

    Re: Partial file name from cell

    Thank you, I couldn't get it to work like that, so I used two indirect which has done the trick, not sure where I was going wrong.

    Now I have another problem in that it appears that indirect doesn't work with a closed workbook!

    Thanks,
    Kevin

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,369

    Re: Partial file name from cell

    No, it doesn't, but then you didn't say that this would be a requirement ... Sorry!

+ 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. [SOLVED] Importing a text file by vba referring to a cell for file name & file path
    By Vivek2705 in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 12-01-2017, 08:54 AM
  2. [SOLVED] Loop through files in folder, email file to listed recipient of file name = cell value
    By Groovicles in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-04-2017, 03:41 PM
  3. [SOLVED] Compare cell in one file to same cell in another file, continue macro only if cells match
    By CherylC in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-24-2014, 09:31 PM
  4. TXT Files + Cell Content => TXT File (1 new file for each cell)
    By nini86 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-15-2013, 01:07 PM
  5. Open 2nd file(CSV) from cell reference, copy columns to main file & close 2nd file
    By Langchop in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-31-2013, 05:09 AM
  6. Replies: 1
    Last Post: 07-14-2007, 07:25 AM
  7. Copying of cell text from one file to paste as cell comments in a 2nd file
    By Wayne in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-02-2005, 02:06 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