+ Reply to Thread
Results 1 to 2 of 2

Comparing sets of strings to find the latest file in a folder

  1. #1
    Registered User
    Join Date
    09-10-2012
    Location
    NY, NY
    MS-Off Ver
    Excel 2010
    Posts
    13

    Comparing sets of strings to find the latest file in a folder

    Hi all!

    So I have files timestamped with "somestuff # 09-17-12.xlsx", where the date (09-17-12) changes everytime I create a new file according to the date it is created (we assume here that there is never more than one file/day created).

    I want to compare a batch of files with different dates and for VBA to pick out the most recent file according to this method.

    So far I have managed to isolate the 09 as the Month, the 17 as the Day, and the 12 as the year, and now am looking at comparing using nested if clauses for year, month, and day (as necessary), in order to find my most recent file.

    Here is my code so far:

    Please Login or Register  to view this content.
    Thanks again!


    Moderator Edit:

    Welcome to the forum, Dunctonsteel.

    Please notice that [CODE] tags have been added to your post. The forum rules require them so please keep that in mind and add them yourself whenever showing code in any of your future posts. To see instructions for applying them, click on the Forum Rules button at the top of the page and read Rule #3.
    Thanks.
    Last edited by Cutter; 10-15-2012 at 05:07 PM. Reason: Added code tags

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Comparing sets of strings to find the latest file in a folder

    try this
    Please Login or Register  to view this content.
    If solved remember to mark Thread as solved

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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