+ Reply to Thread
Results 1 to 4 of 4

Move all files in a folder to a new folder it datetime less the latest datetime

  1. #1
    Forum Contributor
    Join Date
    07-11-2010
    Location
    Minneapolis, USA
    MS-Off Ver
    Excel 2016
    Posts
    308

    Move all files in a folder to a new folder it datetime less the latest datetime

    I am trying to "move" all files of any name in a folder to a new folder who's date time of making is less then the most resent date time found, i.e I only want the most resent file (chosen by date and time of its making not its file name) to remain in the folder all other files moved to a new Folder

    I can find the most resent file by date time with the function : LatestDateTime but the sub Copy_Files_Dates is not moving the files

    The sub is not executing the If statement

    Please Login or Register  to view this content.
    I have been tring to get this for a long time but am not getting it!

    Thanks

    Please Login or Register  to view this content.

    LatestDateTime function:
    Please Login or Register  to view this content.
    Last edited by capson; 04-01-2016 at 11:10 PM.

  2. #2
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: Move all files in a folder to a new folder it datetime less the latest datetime

    This works...
    Please Login or Register  to view this content.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  3. #3
    Forum Contributor
    Join Date
    07-11-2010
    Location
    Minneapolis, USA
    MS-Off Ver
    Excel 2016
    Posts
    308

    Re: Move all files in a folder to a new folder it datetime less the latest datetime

    Hello sktneer, thank you that worked great!

  4. #4
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: Move all files in a folder to a new folder it datetime less the latest datetime

    You're welcome. Glad I could help.
    Thanks for the feedback also.

+ 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. Replies: 1
    Last Post: 01-28-2019, 06:55 PM
  2. Create folder and move files to that folder based on file name
    By biznez in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-26-2016, 06:58 PM
  3. if statement for datetime value between two other datetime values
    By OSepulvedaIII in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-15-2016, 10:37 AM
  4. [SOLVED] VBA Code to Move Individual Files from 1 Folder to a new Folder
    By mike.lawrie448 in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 11-21-2014, 07:05 AM
  5. Replies: 9
    Last Post: 11-28-2013, 05:20 PM
  6. Based on a Column datetime value auto calculate and populate a datetime range
    By rajashanmuga in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-22-2010, 04:10 PM
  7. Move Files from Folder to Folder
    By THE_RAMONES in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-25-2006, 04:25 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