no calculation during readin large cols (Speed)

  • Thread starter Thread starter iwl
  • Start date Start date
I

iwl

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.
 
Hello

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

greetings
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top