This should be stupid simple but I cannot find a solution to save my life. I am trying to print out an array to cells without looping through the array. The calculations for the array take less than a second but placing values onto the page is taking up to 10 seconds. I have run into the same problem in writing python to Excel for another project and found a solution (what I am trying to do now is much more easily done in Excel which is why I am using VBA). I have distilled the problem to the code below. Any help would be much appreciated.
Sub test()
Dim myarr(101) As Double
Range("A1:A1000").Value = "" 'just to clear the last run
For i = 1 To 100
myarr(i) = (i ^ 2 + 0.01) 'arbitrary. just want to fill the array with something.
Next i
Range("A1:A100").Value = myarr 'only gives me a bunch of zeros
'Range("A1:A100").Value = Evaluate(myarr) 'same thing
End Sub
Sub test()
Dim myarr(101) As Double
Range("A1:A1000").Value = "" 'just to clear the last run
For i = 1 To 100
myarr(i) = (i ^ 2 + 0.01) 'arbitrary. just want to fill the array with something.
Next i
Range("A1:A100").Value = myarr 'only gives me a bunch of zeros
'Range("A1:A100").Value = Evaluate(myarr) 'same thing
End Sub