Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Write 3d array to range
Hi,
I have an array defined as: Dim team_vs_team_array(15, 15, 5) Through code I populate each value within the array reading from various worksheets, and completing calculations along the way (each value is an integer). Through the Watch function in VBA, I can confirm that the array is holding the data the way I expect. How can I accomplish the following: Worksheets("temp").range("c4:ct19") = team_vs_team_array I have been reading he archived messages, and thus far have not been able to come up with a solution that fits my problem. I am working in XL2003. thanks in advance. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Write 3d array to range
You need to loop the values to assign the 3D array to a 2D range
something like....... Dim i As Integer, j As Integer, k As Integer For i = 0 To 5 For j = 1 To 16 For k = 1 To 16 Cells(k + 3, j + 2 + i * 16) = team_vs_team_array(k - 1, j - 1, i) Next Next Next -- Cheers Nigel wrote in message ups.com... Hi, I have an array defined as: Dim team_vs_team_array(15, 15, 5) Through code I populate each value within the array reading from various worksheets, and completing calculations along the way (each value is an integer). Through the Watch function in VBA, I can confirm that the array is holding the data the way I expect. How can I accomplish the following: Worksheets("temp").range("c4:ct19") = team_vs_team_array I have been reading he archived messages, and thus far have not been able to come up with a solution that fits my problem. I am working in XL2003. thanks in advance. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Write 3d array to range
Thanks Nigel, I had to tweak the cell assignment slightly but that was definitely the key to the solution. Dave On Dec 31, 12:33 am, "Nigel" wrote: You need to loop the values to assign the 3D array to a 2D range something like....... Dim i As Integer, j As Integer, k As Integer For i = 0 To 5 For j = 1 To 16 For k = 1 To 16 Cells(k + 3, j + 2 + i * 16) = team_vs_team_array(k - 1, j - 1, i) Next Next Next -- Cheers Nigel wrote in oglegroups.com... Hi, I have an array defined as: Dim team_vs_team_array(15, 15, 5) Through code I populate each value within the array reading from various worksheets, and completing calculations along the way (each value is an integer). Through the Watch function in VBA, I can confirm that the array is holding the data the way I expect. How can I accomplish the following: Worksheets("temp").range("c4:ct19") = team_vs_team_array I have been reading he archived messages, and thus far have not been able to come up with a solution that fits my problem. I am working in XL2003. thanks in advance. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to write an array to a range without looping | Excel Worksheet Functions | |||
How do I write an array to include all worksheets in a workbook? | Excel Worksheet Functions | |||
write array to range | Excel Programming | |||
Write 1st and 2nd dimension array values to cells | Excel Programming | |||
Write to Array from other closed Excel file | Excel Programming |