View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Adding to an array

Hi Otto,

here is one way

myArray1 = Array("A", "B", "C")
myArray2 = myArray1
ReDim Preserve myArray2(LBound(myArray2) To UBound(myArray2) + 1)
myArray2(UBound(myArray2)) = "D"

--

HTH

RP

"Otto Moehrbach" wrote in message
...
Excel 2002, WinXP
Let's say I have an array, MyArray, consisting of A, B, C. (Strings only)
Now lets say that I want to build another array, OtherArray, consisting of
the same A, B, C, but having D as well. I know that I can build the
OtherArray as simply A, B, C, D but I don't want to do that. I want to
build the OtherArray by referencing MyArray and tacking D on to it.
How do I code the building of the OtherArray by using MyArray and D?
Thanks for your help. Otto