Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Importing large file


Hi!
I sometimes need to import a data file that is over
one-hundred-thousand lines long. Usually I break-up the report into
several smaller reports and then consolidate them into several sheets
of an excel workbook.
Is there a way to do this in VBA that could do the entire file (100,000
lines or more) at once?

Any help or suggestions would be greatly appriciated! THANKS!!


--
Brian Matlack
------------------------------------------------------------------------
Brian Matlack's Profile: http://www.excelforum.com/member.php...fo&userid=3508
View this thread: http://www.excelforum.com/showthread...hreadid=536126

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 400
Default Importing large file

Difficult to answer without knowing details of your source file:
1. Does it have column headers? (Or can it have column headers?)
2. Are the columns delimited or fixed width?

If the answers are Yes on both counts, you can use ADO to read the file &
CopyFromRecordset to send 65536 rows (or fewer) at a time to sheets, adding
sheets as you go along.

If the answers are not Yes on one or more counts, you can read the source
file one line at a time and send to Excel; if you keep a count of the number
of lines sent, you can add sheets as you go along.

"Brian Matlack" wrote:


Hi!
I sometimes need to import a data file that is over
one-hundred-thousand lines long. Usually I break-up the report into
several smaller reports and then consolidate them into several sheets
of an excel workbook.
Is there a way to do this in VBA that could do the entire file (100,000
lines or more) at once?

Any help or suggestions would be greatly appriciated! THANKS!!


--
Brian Matlack
------------------------------------------------------------------------
Brian Matlack's Profile: http://www.excelforum.com/member.php...fo&userid=3508
View this thread: http://www.excelforum.com/showthread...hreadid=536126


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 (too) large data file Ian Excel Discussion (Misc queries) 1 August 9th 06 07:45 AM
Importing a large file hmm Excel Discussion (Misc queries) 1 August 2nd 06 12:29 PM
Importing a large text file hmm Excel Discussion (Misc queries) 4 March 15th 06 03:13 PM
Importing a large txt file Luis[_6_] Excel Programming 2 June 5th 05 05:03 PM
Importing a large text file (65536) Chip Pearson Excel Programming 0 May 18th 04 09:24 PM


All times are GMT +1. The time now is 09:03 AM.

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

About Us

"It's about Microsoft Excel"