I have learned that " set arrayX=range("xxxx") " allows me to handle the range as an array where I can fill values.... arrayx(3,2)=valuex automatically write valuex in the third row and second column of range("xxxx") as if it were a mirror of the array... My question is:
For speed purposes on large worksheets it is much faster to program on an array than through formulas on a worhsheet range. I have tried to recover array values to the worksheet using FormulaArray but it is very slow... do you know a better way to transfer values from an array in memory to a range on a worksheet....
Let me illustrate...in real case Rnd() can be any formula
Sub MIRRORrange()
Dim rank(1 To 200, 1 To 200)
For rowx = 1 To 200
For colx = 1 To 200
rank(rowx, colx) = Rnd()
Next colx
Next rowx
Application.ScreenUpdating = False
range("results").FormulaArray = rank
Application.ScreenUpdating = True
End Sub
Calculation of rank takes less than one second, retrieving it more than one and a half minute.
Thank you
Bookmarks