+ Reply to Thread
Results 1 to 4 of 4

Help with Finding the Most Recent File

  1. #1
    Registered User
    Join Date
    11-05-2012
    Location
    Boston, MA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Help with Finding the Most Recent File

    So I am basically new to Macros; I took Java a long time ago. I am trying to create a macro where it goes into a folder of my choice and it pulls out the most recent file.

    Example:

    Folder is - C:\Users\ywatanabe\Desktop\Security Database\Vendor Out\

    Files look like - vendor-195709 - 10.31.2012; vendor-195709 - 11.05.2012; etc.

    Can anyone help me create a macro so that it looks up the vendor number and then goes to the most recent one?

    It this possible?



    Thanks,
    -B

  2. #2
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: Help with Finding the Most Recent File

    Is this exactly the file names "vendor-195709 - 10.31.2012". If so will the created date of the file work or do we need to look at the date in the file name?
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  3. #3
    Registered User
    Join Date
    11-05-2012
    Location
    Boston, MA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Help with Finding the Most Recent File

    Mike,

    The files get updated every so often and I need to pull information out of the most recent one. I did this manually in a cell by selecting the file. I am trying to create a macro that will look through a folder with different vendors and pulling the one that is most recent.

    The exact name of the file is "vendor-195709 - xx.xx.xxxx" where the X's are the most current date it was updated. I was hoping we could do something like enter today's date and it would go down the list day by day until it finds the first file. I guess we can also look at the created date but I don't really know.

    All I'm looking for is the most recent file to pop into the cell so I can indirectly reference it into the formula that pulls the data.

    Do you know what to do?!

    Thanks,
    -B
    Last edited by barryckulig; 11-05-2012 at 11:15 AM.

  4. #4
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: Help with Finding the Most Recent File

    Maybe this can work

    Please Login or Register  to view this content.

+ 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