Alan,
Thanks for your help! I really appreciate it.
Although I'm still a novice when it comes to VBA, I have learned a lot from
you when it comes to manipulating arrays.
Thanks again,
Bob
"Alan Beban" wrote:
> The array elements in the "rows" below the appended array will be blanks:
>
> 'Assign to a variable the number of "columns" in each array
> ub12 = UBound(arr1, 2)
>
> 'Increase the number of "columns" of the larger array (arr1)
> 'to accommodate the appended array (arr2); this appends an
> 'array of blanks to the right of the larger array.
> ResizeArray arr1, , 2 * ub12
>
> 'Replace the top portion of the array of blanks with the
> 'array to be appended
> ReplaceSubArray arr1, arr2, 1, ub12 + 1
>
> The ResizeArray line can be accomplished without resort to the
> downloaded functions, since it's only the upper bound of the last
> dimension that is being changed:
>
> ReDim Preserve arr1(1 to UBound(arr1), 1 to 2 * ub12)
>
> Whatever, once you've resized the first array, the ReplaceSubArray
> function indeed accomplishes what you are trying to do; which, by the
> way, can be accomplished simply by looping to add the array elements to
> the first array. As with the functions generally, the ReplaceSubArray
> function simply has the appropriate looping, and the starting points,
> built into it.
>
> Alan Beban
>
> Bob wrote:
> > I have 2, two-dimensional Variant arrays. Both arrays have the same number
> > of "rows". However, each array has a different number of "columns".
> >
> > Is it possible to combine both arrays in such a way that the 2nd array is
> > appended to the right (rather than to the bottom) of the 1st array?
> >
> > I have looked at both Beban's and Pearson's excellent (and indispensable)
> > UDFs, but unless I'm missing something, none of the UDFs appear to accomplish
> > what I'm trying to do.
> >
> > Any guidance in this area would be greatly appreciated. Thanks.
> >
>
|