+ Reply to Thread
Results 1 to 7 of 7

Dated folders to read files from

  1. #1
    Registered User
    Join Date
    06-11-2012
    Location
    London, UK
    MS-Off Ver
    Excel 2007
    Posts
    7

    Question Dated folders to read files from

    Hi,

    I'm pretty pants with Excel and the last VB I did was around 14 years ago (Just had an age realisation moment there) so I wonder if someone can help me.


    I need to read external sheets from folders based on dates. So for example:

    • On sheet titled "Dec-12", in cell A1 I have the value "Dec-12", and I want to read the sheet "figures.csv" from the relatively pathed folder "./Dec-12".
    • On sheet titled "Jan-13", in cell A1 I have the value "Jan-13", and I want to read the sheet "figures.csv" from the relatively pathed folder "./Jan-13".
    • On sheet titled "Feb-13", in cell A1 I have the value "Feb-13", and I want to read the sheet "figures.csv" from the relatively pathed folder "./Feb-13".


    I tried making a Name alias based on cell A1 to pass into another name alias in the middle of the filename but it didn't work.

    Googling the problem confuses me.


    Can anyone help me with a simple solution for this?


    Thanks in advance,

    Greg

  2. #2
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Dated folders to read files from

    For 2007 it will be something like this.
    BTW, is the cell formatted as a date?
    Please Login or Register  to view this content.
    Be fore warned, I regularly post drunk. So don't take offence (too much) to what I say.
    I am the real 'Napster'
    The Grid. A digital frontier. I tried to picture clusters of information as they moved through the computer. What did they look like? Ships? motorcycles? Were the circuits like freeways? I kept dreaming of a world I thought I'd never see. And then, one day...

    If you receive help please give thanks. Click the * in the bottom left hand corner.

    snb's VBA Help Files

  3. #3
    Registered User
    Join Date
    06-11-2012
    Location
    London, UK
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Dated folders to read files from

    The cell is formatted as a date right now, but it doesn't need to be.

    Is there a good 1-pager I can read on how to implement this code? I'm outside of my knowledge/comfort zone on this.

    Thanks for your help.

    G

  4. #4
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Dated folders to read files from

    This is only a small fraction of the code needed to get what you are after. I just assumed you needed to know how to get the path. Sorry.

    My advise is , post two sample workbooks. One where you want the data to be saved into and the other from where the data will be taken from, also a brief explanation of what data you need transfered. From there some code can be written

  5. #5
    Registered User
    Join Date
    06-11-2012
    Location
    London, UK
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Dated folders to read files from

    I will put something together and post when I get a chance. I can't post my actual worksheet due to sensitivity of the information.

    Will have to be tomorrow now, as I'm occupied!

    Appreciate your input though sir.

    Greg

  6. #6
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Dated folders to read files from

    Not a problem. Of coarse take out sensitive data. I have subscribed to this thread so when ever you get a chance. cheers Dave

  7. #7
    Registered User
    Join Date
    06-11-2012
    Location
    London, UK
    MS-Off Ver
    Excel 2007
    Posts
    7

    Arrow Re: Dated folders to read files from

    So attached is an example series of sheets akin to what I'm trying to achieve. I'm extracting from a data set using SUMPRODUCT.

    How can I tie the folder name and sheet look-up to either the sheet name or the contents of cell A1?

    Cheers.

    G
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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