![]() |
Array assignment
Hi,
I have two arrays that I'd like to assign to a different 2 dimensional array. For example, array1 is one dimensional and so is array2. These arrays are returned to me via different sub procedures. I'd like to assign the array values of array1 and array2 to a new array named array3 which is 2 dim i.e. has rows and cols. I know the following wouldn't work i.e. need a loop or something...any pointers will be appreciated. array3(r, 1) = array1 array3(r, c) = array2 Thanks for help. |
Array assignment
Hi
Look at this example: Sub bbb() Dim MyArray1(10) Dim MyArray2(10) Dim MyArray3 ReDim MyArray3(UBound(MyArray1), 2) For r = LBound(MyArray3, 1) To UBound(MyArray3, 1) MyArray3(r, 1) = MyArray1(r) MyArray3(r, 2) = MyArray2(r) Next End Sub Regards, Per "Varun" skrev i meddelelsen ... Hi, I have two arrays that I'd like to assign to a different 2 dimensional array. For example, array1 is one dimensional and so is array2. These arrays are returned to me via different sub procedures. I'd like to assign the array values of array1 and array2 to a new array named array3 which is 2 dim i.e. has rows and cols. I know the following wouldn't work i.e. need a loop or something...any pointers will be appreciated. array3(r, 1) = array1 array3(r, c) = array2 Thanks for help. |
All times are GMT +1. The time now is 01:24 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com