View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Leo Heuser[_2_] Leo Heuser[_2_] is offline
external usenet poster
 
Posts: 111
Default Declare Multidimensional Arrays

Thanks, Alan.
Very strange indeed! I just did a search in my
archive of this group and found my answer right away.
I'm on the msnews.microsoft.com server

Here then is my answer in case Brent also can't
find it. Very much like your own solution.

-----------------------------

Hello Brent

Here's one way to do it, if I have understood you
properly. All Array() must have the same number
of elements (here 3)


Sub CreateArray()
'Leo Heuser, 11 Aug. 2003
Dim lColumn As Long
Dim EndArray() As Variant
Dim lRow As Long
Dim PartArray(2) As Variant


PartArray(0) = Array("a", "b", "c")
PartArray(1) = Array("d", "e", "f")
PartArray(2) = Array("g", "h", "i")

ReDim EndArray(1 To UBound(PartArray) + 1, UBound(PartArray(0)))

For lRow = LBound(EndArray, 1) To UBound(EndArray, 1)
For lColumn = LBound(EndArray, 2) To UBound(EndArray, 2)
EndArray(lRow, lColumn) = PartArray(lRow - 1)(lColumn)
Next lColumn
Next lRow

For lRow = LBound(EndArray, 1) To UBound(EndArray, 1)
For lColumn = LBound(EndArray, 2) To UBound(EndArray, 2)
MsgBox "(" & lRow & "," & lColumn & ") " & _
EndArray(lRow,lColumn)
Next lColumn
Next lRow
End Sub


--
Best Regards
Leo Heuser
MVP Excel

-------------------------------------

"Alan Beban" skrev i en meddelelse
...
Leo,

I don't find any post by you on that date in my archives of this group
nor in a Google Search (other than the post below).

Alan Beban

Leo Heuser wrote:
I answered your very same question in this group on 11 Aug,
but you never replied, so it's difficult to see, what you're after.