Hi Jon,
I wanna write a sub that can draw a polyline with coordinates defined by
a selected range. I used your method first but got run time error on
Addpolyline(arr). I need to use single array to avoid the error.
Jon Peltier wrote:
arr is a variant array, which the OP didn't want. If you try to declare
arr() as anything but a variant, you get a type mismatch error in
arr = r.Value
To the OP: Why don't you want a variant array? They are the fastest way to
get data from a worksheet into VBA. If you need a typed array, you could use
a variant array to get the data, then transfer the data into your typed
array, and this would be much faster than looping cell by cell to populate a
typed array. I'm not sure if using the typed array makes much difference if
you have to process it into the typed array before using the typed data.
- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______
"Gary''s Student" wrote in message
...
Sub equiangular()
Dim r As Range
Set r = Range("A1:C13")
ReDim arr(1 To 13, 1 To 3)
arr = r.Value
End Sub
is one way
--
Gary's Student
gsnu200705
"equiangular" wrote:
I do not want a variant array.