Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
dan dan is offline
external usenet poster
 
Posts: 113
Default Combining two arrays

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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
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?
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 171
Default Combining two arrays

The freely downloadable file at http://home.pacbell.net/beban contains
at least a couple of functions that might be helpful in combining
arrays, depending on exactly what you're trying to accomplish. They do
usually involve looping, but that looping is pre-written. If you have
any interest in that, you might post back with some details. E.g., are
the arrays the same sizes? Same number of rows, different number of
columns? Vice versa? Are they of the same variable type?

Alan Beban

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?


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Combining arrays for a Lookup function Blue Max Excel Worksheet Functions 5 March 6th 09 11:53 PM
3D Arrays DB Excel Worksheet Functions 2 October 10th 05 03:50 PM
Arrays drtaclem Excel Programming 0 December 10th 03 07:55 PM
arrays and others.. Locachica[_3_] Excel Programming 4 December 3rd 03 09:39 PM
ARRAYS Gary B[_3_] Excel Programming 8 July 14th 03 03:59 AM


All times are GMT +1. The time now is 10:34 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"