+ Reply to Thread
Results 1 to 5 of 5

Automatically increment folder and filename for referenced cell

  1. #1
    Registered User
    Join Date
    05-05-2015
    Location
    Newark, England
    MS-Off Ver
    2013
    Posts
    3

    Automatically increment folder and filename for referenced cell

    Good afternoon

    I have a worksheet with several cells which are referenced from another, closed workbook.

    An example of once such cell (D7) is ='C:\Users\leonj_000\Documents\Dissertation - INSM025\FOI\FOI Responses\6\[6.xlsx](1) Project Management'!$C$3

    What I would like to do is have a similar formula on the following row (D8) which would reference 'C:\Users\leonj_000\Documents\Dissertation - INSM025\FOI\FOI Responses\7\[7.xlsx](1) Project Management'!$C$3

    I could move each of the files into a single folder if it is easier to just increment the filename.

    I have looked at Indirect and other things but cant figure it out.

    Thanks

    Leon

  2. #2
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: Automatically increment folder and filename for referenced cell

    You cannot use indirect on closed workbooks without VBA.

    What you can do is a simple find and replace on each column then they are hard coded.
    What I have done in the past is simply pull that worksheet into the workbook I am working in, and kill the external links because they are proper annoying anyway.
    Please ensure you mark your thread as Solved once it is. Click here to see how.
    If a post helps, please don't forget to add to our reputation by clicking the star icon in the bottom left-hand corner of a post.

  3. #3
    Registered User
    Join Date
    05-05-2015
    Location
    Newark, England
    MS-Off Ver
    2013
    Posts
    3

    Re: Automatically increment folder and filename for referenced cell

    I have three worksheets in each workbook, and 228 workbooks - so lots of sheets. So whilst I could copy them into the master workbook, that would be nearly 700 sheets.

    Is there a VBA way which someone could help me with?

    Thanks in advance.

  4. #4
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: Automatically increment folder and filename for referenced cell

    VBA can be setup to pull the data in for you into one master sheet.

    Is there some logical manner in which you are pulling the data from 700 these 3 tabs and 228 sheets?

  5. #5
    Registered User
    Join Date
    05-05-2015
    Location
    Newark, England
    MS-Off Ver
    2013
    Posts
    3

    Re: Automatically increment folder and filename for referenced cell

    Yes, there are 16 cells in the master workbook, D2 through S2, and each of those cells (on the same row) pull data from one of the three sheets I mentioned.

    D, E & F take data from sheet one
    G, H, I, J take data from sheet 2
    K through S take data from sheet 3

    The data in those remote cells is consistent for every workbook, it is just that the filename of the workbooks are different. It is basically a questionnaire being completed, and I have named each questionnaire by the identifier for that organisations return, a number between 1 and 238.

    So as an example for row 7 (which is actually return 6 because I have a header row) looks like this; (one example cell per remote sheet)

    D7 = ='C:\Users\leonj_000\Documents\Dissertation - INSM025\FOI\FOI Responses\6\[6.xlsx](1) Project Management'!$C$3

    G7 = ='C:\Users\leonj_000\Documents\Dissertation - INSM025\FOI\FOI Responses\6\[6.xlsx](2) Service Management'!$C$3

    K7 = ='C:\Users\leonj_000\Documents\Dissertation - INSM025\FOI\FOI Responses\6\[6.xlsx](3) Natl. Systems & Frameworks'!$C$3

    So on the next row, row 8, I would want the data from filename 7.xlsx being pulled in.

    Does that make sense?

    Thanks

    Léon

+ 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. Code to paste image from filename into cell that is referenced?
    By ChristophExcel in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-20-2014, 01:32 PM
  2. [SOLVED] Save File to folder Where folder is referenced in cell
    By Will_iam in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-16-2013, 08:35 AM
  3. Variable filename, referenced from another cell
    By christenprochaska in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-22-2013, 09:51 PM
  4. [SOLVED] Macro to Increment and Print to PDF filename from merged cell
    By ahjualune in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-17-2012, 06:24 AM
  5. Opening a Folder from Referenced Cell (Macro)
    By narr in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-31-2011, 10:34 PM

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