K
KR
I pull data into an array and perform several calculations; now I just need
to dump it back into my spreadsheet. For some reason, the code below is
taking 3-4 seconds per loop (of v); each loop only has to paste 8 values in
8 cells! The rest of the code runs very, very fast, it is only this section
of code that is so slow. Any suggestions on why it might be slow, and how to
speed it up?
Thanks,
Keith
XL2003 on Win2000
<snip>
For v = 1 To LastOut 'about 3000+ rows
vt = Trim(Str(v)) 'do this conversion once, instead of with each
range assignment
Application.StatusBar = "Pasting row " & vt & " of " & Str(LastOut) 'this is
so I know how fast it is[n't] going
For PasteCol = 17 To 20
UsePasteCol = Chr(PasteCol + 64)
Sheet3.Range(UsePasteCol & vt).Value = OutArr(PasteCol, v)
Next
For PasteCol = 23 To 26
UsePasteCol = Chr(PasteCol + 64)
Sheet3.Range(UsePasteCol & vt).Value = OutArr(PasteCol, v)
Next
Next
<snip>
to dump it back into my spreadsheet. For some reason, the code below is
taking 3-4 seconds per loop (of v); each loop only has to paste 8 values in
8 cells! The rest of the code runs very, very fast, it is only this section
of code that is so slow. Any suggestions on why it might be slow, and how to
speed it up?
Thanks,
Keith
XL2003 on Win2000
<snip>
For v = 1 To LastOut 'about 3000+ rows
vt = Trim(Str(v)) 'do this conversion once, instead of with each
range assignment
Application.StatusBar = "Pasting row " & vt & " of " & Str(LastOut) 'this is
so I know how fast it is[n't] going
For PasteCol = 17 To 20
UsePasteCol = Chr(PasteCol + 64)
Sheet3.Range(UsePasteCol & vt).Value = OutArr(PasteCol, v)
Next
For PasteCol = 23 To 26
UsePasteCol = Chr(PasteCol + 64)
Sheet3.Range(UsePasteCol & vt).Value = OutArr(PasteCol, v)
Next
Next
<snip>