+ Reply to Thread
Results 1 to 15 of 15

List Files By Dates

  1. #1
    Registered User
    Join Date
    10-07-2012
    Location
    Bonn, Germany
    MS-Off Ver
    Excel 2007
    Posts
    16

    List Files By Dates

    Hi Knowledgeabels,

    I am a Financial Analyst and receive many stock information files each day...

    Is it possible to have an Excel macro which allows me to select files by their date and list them?

    That is, I like to be able to select a date - create or modified - and all corresponding files will be listed by their names and locations.

    Thank you very much for your time ans thoughts is advance.

    Friendly regards,

    Wolfgang

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,893

    Re: List Files By Dates

    Look at this link.

    http://stackoverflow.com/questions/1...-date-modified
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    10-07-2012
    Location
    Bonn, Germany
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: List Files By Dates

    Hi Alan,

    thank you for your quick reply.

    I tried the code and it barks at:
    Cells(i, 3) = MyFile.DateLastModified ' <= added to modify code

    Wolfgang

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,893

    Re: List Files By Dates

    What is the error message associated with that line of code.

  5. #5
    Registered User
    Join Date
    10-07-2012
    Location
    Bonn, Germany
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: List Files By Dates

    Invalid qualifier...

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,893

    Re: List Files By Dates

    Yeah, I tested and got the same message. I looked around the internet and found a solution that I tested and worked for me.

    http://excelexperts.com/vba-tips-lis...-folder?page=1

    Download his file that contains all the code. Make sure that Microsoft Scripting Runtime is checked in your references in the VBE

    Alan

  7. #7
    Registered User
    Join Date
    10-07-2012
    Location
    Bonn, Germany
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: List Files By Dates

    Alan,

    that's fine...
    But I like to be able to specify a date and have the code look for all files that match that date and not all files...

  8. #8
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: List Files By Dates

    Hi alienware

    I tested this and received the expected results...you'll need to define how to set the Date to Compare To...I've hard Coded it as 4/1/2015
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by jaslake; 04-18-2014 at 04:33 PM.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  9. #9
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,893

    Re: List Files By Dates

    @John
    I understand what the split function does in your code, but what does the (0) at the end signify?

    Alan

  10. #10
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: List Files By Dates

    Hi Alan

    It says to use the first element of the array (0 based)...

  11. #11
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: List Files By Dates

    @Alan

    Can't edit posts for some reason...follow up thought...the fist element, in this instance, is the Date...

  12. #12
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,893

    Re: List Files By Dates

    @John
    Thanks. I was trying to figure something out along those lines, but was not aware of the Split function. Thanks for expanding my horizons.

    Alan

  13. #13
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: List Files By Dates

    @Alan

    That's what we do isn't it...always looking for ways...

    Thanks for the Rep...

  14. #14
    Registered User
    Join Date
    10-07-2012
    Location
    Bonn, Germany
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: List Files By Dates

    Hi John,

    great stuff - thank you very much!

    But how do I mark this solved???

    Best regards,

    Wolfgang

  15. #15
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,893

    Re: List Files By Dates

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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] From a list of dates that changes in length, make list with all middle dates
    By tinytutu in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-21-2013, 01:56 AM
  2. Replies: 6
    Last Post: 03-11-2013, 06:11 PM
  3. [SOLVED] Highlight Group of Dates if Dates Match List of other Dates
    By martinpgibson in forum Excel General
    Replies: 5
    Last Post: 10-24-2012, 08:14 PM
  4. Noob 4 Help - Macro to LIST ALL FILES IN FOLDER and then IMPORT ALL LISTED FILES
    By StlSmiln in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-25-2012, 04:02 AM
  5. Replies: 1
    Last Post: 01-31-2012, 09:07 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