View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Alan Beban[_2_] Alan Beban[_2_] is offline
external usenet poster
 
Posts: 783
Default How To Fill 2D Arrays Easily

wrote:
Good Morning Everybody,
I'm sure I've seen this in a post somewhere but for the life of me I
can not find it ! so here goes.

I have a 2D array...

Dim testarray()
ReDim testarray(1 To 5, 1 To 20)

testarray() = Range("B9:L9").Value

The above line fills the 1st row of the array, BUT HOW DO I FILL THE
THE OTHER ARRAY ROWS USING CELL RANGES ?

Thanks for your help....again

Donna

Well, it doesn't *fill* the first row of the array, which is 20 elements
long and you're filling only the first 13 elements of that row. But be
that as it may, you *fill* the other rows essentially the same way:

testarray() = Range("B9:L13")

Alan Beban