Append One Array to Another, and Consolidate
Stratuser wrote:
I have two arrays, both of which are two-dimensional (for example,
Array1(100,5) and Array2(300,5), of the same type (Variant). I want to
combine them into a single array, and then I want to consolidate any
duplicate elements. Any ideas on the best way to do this?
In the past, I've handled this by just dumping the data from the arrays onto
a blank worksheet, sorting the data there, and then doing a search loop that
consolidates the duplicate elements. I'm thinking there might be a way to do
it entirely within arrays, off the worksheet.
I'd do it this way:
go through the smaller array, check for each element if the values
duplicate - if not - redim the bigg array by one, and add the just
processed element.
Does that make sense?
|