View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Nigel Nigel is offline
external usenet poster
 
Posts: 923
Default Importing Text Data into Excel

Option 1 and 2 are the same. I get the impression that you wish to create
an xls version of each file, but then option 3 does not suggest that. In
any event you will struggle to create 1700 separate sheets in one workbook!

So the best method would be to rename the .txt to .csv, Excel recognises
this as a CSV format and will open the workbook and worksheet auotmatically,
so if you are not formatting the sheet etc., then you do not need to convert
anything. Just change each file into Bom1.csv, Bom2.csv etc. and open them
from within Excel.

No VBA needed!

Cheers
Nigel

"SowBelly" wrote in message
...
Hello:

I have about 1300 CSV files that are all exactly formatted the same
and named similarly i.e. Bom1.txt, Bom2.txt., etc. I want to convert
each .txt file into an .xls file. Is there a way to do this by either:

1. Creating a macro to convert the .txt file to a .xls file. OR

2. Using VBA to batch convert several .txt files to individual .xls
files. OR

3. Using VBA to batch convert several .txt files to individual sheets
in a single .xls file.

The .xls files could be saved with the same name as the .txt files in
the same directory.

Appreciate your help.

"Pigs can't be humans, but humans can be Pigs!"

Eating at the trough of life.

Oink!

SowBelly