[dba-Tech] Determine the last file in a folder

Gustav Brock Gustav at cactus.dk
Fri Aug 10 09:38:28 CDT 2007


Hi Arthur

You could read in the filenames one by one with Dir.
Convert the filename to YYMMDD to sort correctly, and detect if it is larger than the previously stored; if so, replace the stored filename with the current.
When you have read all the filenames, you are done.

/gustav

>>> fuller.artful at gmail.com 10-08-2007 16:20 >>>
Hi all,

I'm working on some Excel VBA in which I need to determine the last file in
a folder. The folder contains one file for each business day in a month, all
named like this: 062907 (June 29). I can't necessarily trust the date stamp
on the file so I have to go by the filenames and determine the "largest"
filename, as it were.

Any suggestions?

TIA,
Arthur





More information about the dba-Tech mailing list