I've a macro to read the file names in a folder and move the file names to a cell. 1 cell per file name. File names has dates but the single digit dates don't have leading zeros so they are not sorted correctly and I've to insert the leading zeros for this to work correctly. Is there a way to make excel sort the file name correctly.
File names appear as below in explorer:
abcd 10-8-10
abcd 10-9-10
abcd 10-10-10
but after running the macro they appear as below in the cell:
abcd 10-10-10
abcd 10-8-10
abcd 10-9-10
Macro:
FNames = Dir("*abcd*.xls")
Do While FNames <> ""
....
.....
....
loop
Bookmarks