Suppose I have a bunch of random numbers in A1:C5000, and I want to create an array, call it NumArray, of these numbers.
This code works:
.
But this code doesn't work:
.
Why can't I dim NumArray as a double? I understand that I could dim it as a double, and loop through the range to fill it, but that would be a lot slower. I'm just trying to understand what's going on here.
This code works:
Code:
Dim NumArray As Variant
NumArray=Range("A1:C5000").Value.
But this code doesn't work:
Code:
Dim NumArray(1 to 5000, 1 to 3) As Double
NumArray=Range("A1:C5000").Value.
Why can't I dim NumArray as a double? I understand that I could dim it as a double, and loop through the range to fill it, but that would be a lot slower. I'm just trying to understand what's going on here.