check for latest backup file

dialup

Board Regular
Joined
Jan 10, 2008
Messages
99
I have a intranet tool which backs up to a csv file every 20 minutes.

When the tool goes down i want to import the data into a set of excel spreadsheets.

the files are named
"Backup" and the date and the time

Backup-2009-02-20-23-40.csv
Backup-2009-02-21-00-00.csv
Backup-2009-02-21-00-20.csv
Backup-2009-02-21-00-40.csv
Backup-2009-02-21-01-00.csv
Backup-2009-02-21-01-20.csv
Backup-2009-02-21-01-40.csv

etc

I have figured out how to get the backup-2009-02-21 (no matter how you format a date vba sees it seperated with/) but want to identify the latest back up for that day.

Can this be done with a macro?
 

Some videos you may like

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

ColinKJ

Well-known Member
Joined
Jan 27, 2009
Messages
983
Hi dialup,

You could run a macro to read and load the file names into sheet and sort them in Decending order, then take the top one for loading

ColinKJ
 

dialup

Board Regular
Joined
Jan 10, 2008
Messages
99
so i just decided to present a userform with 2 comboboxes, one for the hours and the other for the minutes and let the users pick the time themselves
 

Watch MrExcel Video

Forum statistics

Threads
1,123,259
Messages
5,600,575
Members
414,390
Latest member
plimbu

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
Top