Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
A hard one for manipulating arrays
Code reuse. Your procedure combines two arrays. You want to combine arrays
A, B, C, D, E. Use your procedure to bind A and B, then reuse it to combine [AB] and C, [ABC] and D, and finally [ABCD] and E. - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions http://PeltierTech.com _______ "Albert" wrote in message ... Hello and Happy New Year... I recently created a nice little procedure that "bonds" two arrays toghether (see below). I now want to make a procedure that bonds a variable number of arrays (they are all two dimentional and all have the same horizontal Ubound). For example, sometimes I have to bond only 2 arrays, but sometimes I may have to bond 5 of them toghether. I haven't been able to figure it out. Perhaps someone has done something similar or has some ideas? Thanks in advance, Albert C Public RegistrosExistentes() As Variant Public Const TotalFields = 13 Sub ConstruirArrayRegistrosExistentes(Arr1, Arr2) ReDim RegistrosExistentes(1 To (UBound(Arr1, 1) + UBound(Arr2, 1)), 1 To TotalFields) For x = 1 To UBound(Arr1, 1) For Y = 1 To TotalFields RegistrosExistentes(x, Y) = Arr1(x, Y) Next Y Next x For x = 1 To UBound(Arr2, 1) For Y = 1 To TotalFields RegistrosExistentes(UBound(Arr1, 1) + x, Y) = Arr2(x, Y) Next Y Next x End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Manipulating Arrays | Excel Worksheet Functions | |||
Functions for manipulating arrays | Excel Discussion (Misc queries) | |||
Functions for manipulating arrays | Excel Worksheet Functions | |||
Arrays - declaration, adding values to arrays and calculation | Excel Programming | |||
Arrays Take too long. VERY HARD QUESTION. my head hurts : / | Excel Worksheet Functions |