Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Importing Text Data into Excel

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Importing Text Data into Excel

Nigel:

Thanks for the solution. Will try it today.

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

Eating at the trough of life.

Oink!

SowBelly

On Fri, 30 Jul 2004 09:01:23 +0100, "Nigel"
wrote:

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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
importing text file data into excel GradStudent N need Excel Discussion (Misc queries) 1 September 7th 07 09:44 AM
Need to reformat text data before or after importing to Excel Patti Ayala Excel Discussion (Misc queries) 2 October 13th 06 05:53 PM
Importing Text File Data into Excel where records span several row Razorback76 Excel Discussion (Misc queries) 2 June 25th 06 06:36 AM
Importing Text Data mfx_krypt Excel Discussion (Misc queries) 11 September 27th 05 08:00 PM
IMPORTING TEXT DATA Bill C Excel Discussion (Misc queries) 1 May 12th 05 10:05 AM


All times are GMT +1. The time now is 08:11 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"