View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Umlas, Excel MVP[_3_] Bob Umlas, Excel MVP[_3_] is offline
external usenet poster
 
Posts: 1
Default range to VBA array, and doing this fast

You can make it still VERY fast by something like this:
Sub PossibleSolution()
Dim x As Variant, y(44, 7) As Double
x = Range("A1:G44")
For i = 1 To 44
For j = 1 To 6
y(i, j) = x(i, j)
Next
Next
End Sub


"Erich Neuwirth" wrote:

I need to transfer data from a large range to an array
dimmed as double.
Assigning a range to an array dimmed as variant works,
but I am transferring this array to a COM server and
for that transfer I need it as an array dimmed double, not as variant.
Is there a fast way of converting the variant array
to a double array without looping through all the cells?
Or is there another way of getting a range into a double
array fast?