Re: Code Efficiency Suggestions
- From: "Job" <Job@xxxxxxxxxx>
- Date: Thu, 9 Jun 2005 08:42:11 -0600
Thanks for the comments Nick. Not too familiar with this. I'll research as
to how this works. Thanks!
"Nick Hebb" <n.hebb@xxxxxxxxxxx> wrote in message
news:1118299711.247377.50900@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Another option would be to process the data in the background, storing
> it in a bunch of text files (65k rows/file), then import each text file
> into a new sheet using QueryTables. The pseudo code is as follows:
>
>
>
> Create new folder
>
> Outer loop: while not EOF of input file
> create new output file in the new folder
> write field headers to output file
> output file row counter = 0
> Inner loop: while output file row counter <65000 and not input EOF
> read line
> transform contents of line
> write line to output file in csv format (NO SPACE after comma)
> increment output file row counter
> End inner loop
> End outer loop
>
> For each file in new folder
> Select worksheet
> Import data from text file using ActiveSheet.QueryTables
> Next
>
> Delete files and new folder
>
>
>
> I would think that this would much faster since you are pre-processing
> the data without having to interface with the spreadsheet and the Excel
> object hierarchy. QueryTables is very fast and works on formatted text
> files just as well as it does on databases.
>
> Try recording a macro while doing Data > Import External Data > Import
> Data. This will prompt you for a data source. Navigate to the text
> file like you're opening a file, and follow the importing wizard.
>
.
- References:
- Re: Code Efficiency Suggestions
- From: Nick Hebb
- Re: Code Efficiency Suggestions
- Prev by Date: Re: incrementing columns in a loop
- Next by Date: Re: 'ActiveWorkbook.Names.Add Name:' how to make range variable?
- Previous by thread: Re: Code Efficiency Suggestions
- Next by thread: Re: Code Efficiency Suggestions
- Index(es):
Relevant Pages
|