Named range into an array
?????
Dim arr(1 to 5)
arr = Range("xyz")
Alan Beban
Gary''s Student wrote:
Try:
Sub gsnu()
Dim r As Range
Dim v(10)
i = 1
For Each r In Range("xyz")
v(i) = r.Value
i = i + 1
If i = 6 Then Exit For
Next
End Sub
as coded it picks up the first 5 values in "xyz" and does not examine
Range("xyz").Count to get the full range.
Note that Range("xyz") is the equivalent of Range("A1:A5"). A Name is just
a string.
|