I'm using a macro in VBA to load a series of text files into an Excel spreadsheet, via the "dir" command. The files are named, aaa1000, aaa1001....aaa1050. etc. I need the files to load in alphabetical order. Most do. some don't. I'm guessing it has something to do with reading the last modified file, instead of alphabetically. Is there a way to overide this and stick to alphabetical? I'm running xp pro.
Thanks.
Fri, 29 Apr 2005 16:29:45 GMT
Gregg Tayl #2 / 2
Loading text files into Excel using VBA
Quote:
> I'm using a macro in VBA to load a series of text files into an Excel > spreadsheet, via the "dir" command. > The files are named, aaa1000, aaa1001....aaa1050. etc. > I need the files to load in alphabetical order. Most do. some don't. > I'm guessing it has something to do with reading the last modified > file, instead of alphabetically. > Is there a way to overide this and stick to alphabetical? > I'm running xp pro.
> Thanks.
I was trying to do the same thing and this was just what I needed ! See the FoundFiles Object in Microsoft Visual Basic Help.