Just for the heck of it, I filled 350,000 cells and multiplied the values by 2.
Filled the Cells so
Sub Fill_Many_Cells()
With Range("A1:A350000")
.Formula = "=ROW()"
.Value = .Value
End With
End Sub
Then I ran this code
Sub Trial_Run()
Dim largeArr, t, i As Long
t = Timer
largeArr = Range("A1:A" & Cells(Rows.Count, 1).End(xlUp).Row).Value
For i = LBound(largeArr) To UBound(largeArr)
largeArr(i, 1) = largeArr(i, 1) * 2
Next i
Range("C1").Resize(UBound(largeArr)).Value = largeArr
MsgBox "This macro took " & Format(Round(Timer - t, 2), "00:00:00.00") & " seconds to run."
End Sub
On several runs it took 0.36 seconds/run
Bookmarks