![]() |
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 |
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 |
All times are GMT +1. The time now is 08:53 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com