Clint,
you might want to check out the file object f1 in your code. I believe you
should be able to use the file object to retrieve the file properties for
the date created or modified. See below link for a description of the
object.
Store the date and names in an array and then create a sort function that
sorts the array by the dates.
Hope this helps,
Felix
http://msdn.microsoft.com/library/de.../jsobjfile.asp
"Clinton Goff" wrote in message
news:kKWsb.196557$Fm2.181263@attbi_s04...
I have written an Excel macro that does some data manipulation. I am
however, having one problem. I am trying to get a list of files from a
certain directory and store them in a "string" array. I need the files to
be listed in this array in order of time and date starting with the oldest
and ending with the newest. Here is the code that I have:
Sub ShowFolderList(folderspec)
Dim fs, f, f1, fc, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(folderspec)
Set fc = f.Files
i = 1
For Each f1 In fc
fname(i) = f1.Name
i = i + 1
Next
With this code, it gives the list in somewhat chronological order, but
there
are a few places where it is out of order. Does anybody know a solution?
Thanks,
Clint