View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
acw[_2_] acw[_2_] is offline
external usenet poster
 
Posts: 100
Default Combining two arrays

Dan

There have been various articles in the newsgroup that cover both your questions. Go to the GOOGLE site and select groups. In the advanced group search, put in combining arrays and the newsgroup microsoft.public.excel.programming. Similarly for sorting arrays.

Discussion there seems to be that the best way to combine arrays is to loop. Alternatively you can use the Array function to make the array of arrays then index the items. Seems you have to know the bounds of the individual arrays.

arr1 = Array("a", "b")
arr2 = Array("c", "d")
arr3 = Array(arr1, arr2)

so arr3 (0) (0) = "a", arr3(0) (1) = "b" ....

Sorting seems to be to build your own code for bubblesort, quicksort etc. Various items give the code needed.

HTH

Tony

----- dan wrote: -----

Is there an easier way to append one array on to another?

I know I can a loop from lbound to ubound of an array putting it in ubound+1 with the appropriate redims but I was hoping for something shorter.

Also while I am here is there an internal array sort function? and if so can it handle multidimensional arrays?