Loading text files into Excel using VBA 
Author Message
 Loading text files into Excel using VBA

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  
 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.


Sun, 01 May 2005 03:25:43 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Importing text file into Excel using VBA - from a word macro

2. Using VBA to develop DBase file using Excel

3. Converting Excel XLA file to XLS file using VBA

4. Finding Text in Excel using VB/VBA

5. How to load BMP file in OLE field using VBA

6. create Excel file using VBA

7. Problems using VBA to link or DAO to import Excel file into Access97

8. Loading text file using StreamReader.Readline()

9. Writing an XML file to sharepoint using VBA in excel

10. Save all inbox messages to a text file (or text files) with VBA

11. Compatibility Problem Using MS Excel 97 VBA on Excel 2000/XP - Causes crashes

12. Running VBA code in EXcel from VB6 using EXcel Objects

 

 
Powered by phpBB® Forum Software