Select one file for each day in directory based on date & time modified

Reinhardt9

New Member
Joined
Feb 23, 2015
Messages
1
Dear all,
Firstly thanks to all the people who post solutions to problems here, it helps me no end and Ive benefited from the collective wisdom in developing my own VBA skills.

Any help with the following would be much appreciated.

I have a directory with several hundred files in, sorting by date modified I have about 5 files for each calendar day all with different time stamps.

What I want to do is copy the earliest file for each day in the directory into a new folder.

eg. A simplified example is if there were four files in the directory from two different days as per the table below the macro would copy files 1 and 3 (the earliest file for each of the two days)

file no. date modified
131/03/2014 5:00
231/03/2014 13:00
330/03/2014 14:00
430/03/2014 15:00

<tbody>
</tbody>


Many thanks in advance for any help!
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.

Forum statistics

Threads
1,215,493
Messages
6,125,128
Members
449,206
Latest member
burgsrus

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top