Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Creating a .csv file that will import to multiple worksheets

If you are asking if Excel can do this on it own, then the answer is No:
Excel expects all data in a such file to be in the same format and will
import to single worksheet. You can of course cut/paste (either manually or
in code) to produce the desired result.

Otherwise you will need to Open the file (check the VBA help for the Open
Statement), read a line and decide which file you are in from the header
info, then read line by line, unless the header tells you how many
lines/bytes you need to deal with.

If you can get the output file correctly formatted in Excel's version of
..csv, Excel can open .csv file directly, so no need for the steps.

NickHK

"mastermind" wrote in message
...
I have the following workflow:

1. An application program is creating several .csv files which have
header information on the 1st line and data on the subsequent lines.

There
are approximately 4 of these files.
2. In Excel, the users open each .csv file separately and go through
the format prompt to display the contents in a worksheet.

Question - can I create single CSV file that contains all 4 files(with
different column formats) that can be imported into Excel as separate
worksheets?

Thx.



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Creating a .csv file that will import to multiple worksheets

I meant that if you can the output csv files in the format that Excel
expects for csv files, there would be no need for the user to go through the
wizard as they would open directly in Excel as a worksheet.

NickHK

"mastermind" wrote in message
...
Thx. This is what I had thought, that the only way to do this would be if
the user had a pre-written macro that would parse the combined file

creating
separate worksheets.

I am curious as to your last statement about getting it into the 'correct'
csv format of Excel - how could I determine this format? Would I save a
workbook with multiple sheets as a csv? I thought that the csv export is

by
worksheet only.

Any help would be appreciated.

"NickHK" wrote:

If you are asking if Excel can do this on it own, then the answer is No:
Excel expects all data in a such file to be in the same format and will
import to single worksheet. You can of course cut/paste (either manually

or
in code) to produce the desired result.

Otherwise you will need to Open the file (check the VBA help for the

Open
Statement), read a line and decide which file you are in from the header
info, then read line by line, unless the header tells you how many
lines/bytes you need to deal with.

If you can get the output file correctly formatted in Excel's version of
..csv, Excel can open .csv file directly, so no need for the steps.

NickHK

"mastermind" wrote in message
...
I have the following workflow:

1. An application program is creating several .csv files which

have
header information on the 1st line and data on the subsequent lines.

There
are approximately 4 of these files.
2. In Excel, the users open each .csv file separately and go

through
the format prompt to display the contents in a worksheet.

Question - can I create single CSV file that contains all 4

files(with
different column formats) that can be imported into Excel as separate
worksheets?

Thx.






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
How 2 import Excel file w/ multiple worksheets ??? akm Excel Discussion (Misc queries) 1 October 1st 09 10:01 PM
how can i import worksheets from multiple workbooks davidp23 New Users to Excel 1 September 1st 06 08:49 PM
Import one column of data from multiple Excel worksheets [email protected] Excel Programming 0 July 11th 06 09:27 PM
Amalgamate Several Worksheets into one file thru Data import M Imran Buhary Links and Linking in Excel 1 May 29th 06 11:08 AM
Amalgamate Several Worksheets into one file thru Data import M Imran Buhary Excel Discussion (Misc queries) 0 May 28th 06 11:29 AM


All times are GMT +1. The time now is 04:34 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"