This example runs in 0.3 seconds on my system: its much faster to transfer
the data in 1 block from the array than doing it cell-by-cell.
Sub test()
Dim RMaster(8615, 24)
Dim i As Long, j As Long
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Application.EnableEvents = False
For i = LBound(RMaster) To UBound(RMaster)
For j = 0 To 23
RMaster(i, j) = i * j
'Cells(i + 2, j + 1) = RMaster(i, j)
Next
Next
Cells(2, 1).Resize(UBound(RMaster) + 1, UBound(RMaster, 2) + 1) =
RMaster
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
Application.EnableEvents = True
End Sub
Charles
___________________________________
The Excel Calculation Site
http://www.decisionmodels.com
"leungkong" <(E-Mail Removed)> wrote in message
news:7F0BBEB8-BECB-44CE-B842-(E-Mail Removed)...
>I use the following code to write the data from a (8615 * 24) array to
> worksheet
> It is very fast before.
> But I don't know why it is slow now.
> Today, I spend 2.5 hours for this.
> I want to know why and how to speed up. Many thanks.
>
> Dim i As Long, j As Byte
> For i = LBound(RMaster) To UBound(RMaster)
> For j = 0 To 23
> Cells(i + 2, j + 1 = RMaster(i, j)
> Next
> Next
>