Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
iwl iwl is offline
external usenet poster
 
Posts: 6
Default no calculation during readin large cols (Speed)

Hello Group,

i read in a lot of data from a file with many lines and put in in the
worksheet with cells

Do Until EOF(InFile)
Input #InFile, X
Worksheets("test").Cells(5, Line).Value = X
Zeile = Zeile + 1
Loop

It seems the whole worksheet is updated for every line so the read in
is very slow.
Can I disable the update during readin, Application.ScreenUpdating =
False does
not help or is the an more effective whay to modify a long Col with ab
buffer or so.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default no calculation during readin large cols (Speed)

Hello

Set the Calulation property to xlManual before reading in the data, en
afterwards put it back on xlAutomatic.

greetings
"iwl" schreef in bericht
...
Hello Group,

i read in a lot of data from a file with many lines and put in in the
worksheet with cells

Do Until EOF(InFile)
Input #InFile, X
Worksheets("test").Cells(5, Line).Value = X
Zeile = Zeile + 1
Loop

It seems the whole worksheet is updated for every line so the read in
is very slow.
Can I disable the update during readin, Application.ScreenUpdating =
False does
not help or is the an more effective whay to modify a long Col with ab
buffer or so.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default no calculation during readin large cols (Speed)

Read the data into a VBA array, then dump it into the sheet in one command:

Dim a() as variant
dim i as long

i=0
redim a(1 to 1)

' open the file etc.

do until eof(infile)
i=i+1
redim a(1 to i)
input #infile, a(i)
loop

worksheets("test").Cells(5,1).resize(i).value = _
worksheetfunction.transpose(a)


- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"iwl" wrote in message
...
Hello Group,

i read in a lot of data from a file with many lines and put in in the
worksheet with cells

Do Until EOF(InFile)
Input #InFile, X
Worksheets("test").Cells(5, Line).Value = X
Zeile = Zeile + 1
Loop

It seems the whole worksheet is updated for every line so the read in
is very slow.
Can I disable the update during readin, Application.ScreenUpdating =
False does
not help or is the an more effective whay to modify a long Col with ab
buffer or so.



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
Improve speed of saving a large Excel file Elmer Excel Discussion (Misc queries) 3 February 5th 07 07:15 AM
Calculation based on 2 cols burnsbyrne Excel Discussion (Misc queries) 2 July 24th 06 05:31 PM
Range.Select 1st pass 13 cols, 2nd paqss 25 cols twice as wide in error? Craigm[_53_] Excel Programming 2 May 2nd 06 11:04 AM
Cond Format:re color 2 cols, skip 2 cols Tat Excel Worksheet Functions 2 June 22nd 05 06:43 PM
Problem with speed of PasteSpecial for large ranges xlb[_2_] Excel Programming 4 February 20th 05 12:18 PM


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