+ Reply to Thread
Results 1 to 4 of 4

Getting a file list into an array filtered by name and date

  1. #1
    Registered User
    Join Date
    04-09-2012
    Location
    Rhode Island
    MS-Off Ver
    Excel 2003
    Posts
    5

    Getting a file list into an array filtered by name and date

    I have a directory of about 3,000 files and I need to get a few filenames into an array.
    So out of this list of files, I would only want the ones that match "Auto Test" and from the last 30 days. I was attempting to use the msoFileDialogFilePicker, but that's turned into a total deadend.

    AAA Test 2016-12-02.csv
    AAA Test 2016-12-05.csv
    AAA Test 2016-12-06.csv
    Auto Test 2016-11-10.csv
    Auto Test 2016-11-11.csv
    Auto Test 2016-11-15.csv
    Auto Test 2016-11-16.csv
    Auto Test 2016-11-29.csv
    Auto Test 2016-11-30.csv
    Auto Test 2016-12-01.csv
    Auto Test 2016-12-02.csv
    Auto Test 2016-12-05.csv
    Auto Test 2016-12-06.csv
    FalseTest 2016-12-02.csv
    FalseTest 2016-12-05.csv
    FalseTest 2016-12-06.csv

    I've been working with these as variables.
    Please Login or Register  to view this content.
    So my array FileNames would result in only these in the array (as of today's date):
    C:\Files\Auto Test 2016-11-30.csv
    C:\Files\Auto Test 2016-12-01.csv
    C:\Files\Auto Test 2016-12-02.csv
    C:\Files\Auto Test 2016-12-05.csv
    C:\Files\Auto Test 2016-12-06.csv

    I know it's not much to go on, I would prefer to post a macro that would require a few minor fixes, but this area (arrays) is not a strength. Any help would be appreciated, I'm spinning in circles on this one. Can it even be done?

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Getting a file list into an array filtered by name and date

    Please Login or Register  to view this content.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Registered User
    Join Date
    04-09-2012
    Location
    Rhode Island
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Getting a file list into an array filtered by name and date

    That is way beyond anything I can do. I work with my usual Excel tools during the day, I'll try it out tomorrow. Thank you so much!

  4. #4
    Registered User
    Join Date
    04-09-2012
    Location
    Rhode Island
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Getting a file list into an array filtered by name and date

    Thank you for your help, but I've discovered I gave a poor description of how I'm using the array. That's on me.

    Basically, I'm doing this:
    Please Login or Register  to view this content.
    I'm currently doing this ArrayOfFiles step with msoFileDialogFilePicker manually, but I'm hoping it can be automatic.

    Also, the date in the filenames "AAA Test 2016-12-02.csv" is also the same as the created/last modified date of the file. So picking the file by date isn't tied only to the filename.

    Thank you again for all your help.

+ 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] Array Formula — Filtered List— Problem
    By blerggh in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-21-2016, 07:14 AM
  2. Array formula to create list of filtered results
    By Kris_cs1 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-16-2014, 02:34 AM
  3. [SOLVED] Getting the array list to from the file itself
    By akhileshgs in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-25-2014, 08:57 AM
  4. [SOLVED] Excel VBA - Issue in Naming Filtered Range on a Filtered List.
    By Vinod Krishna.C in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-06-2014, 01:17 PM
  5. [SOLVED] Count number of unique names in a filtered list (non array)
    By IN_FOR_SIN in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 01-31-2014, 04:07 AM
  6. Replies: 4
    Last Post: 01-18-2013, 05:10 AM
  7. Filtered list into an array
    By Macro1 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-08-2011, 06:17 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