C
Clinton Goff
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
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