Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to write an array to a range without looping Andy Excel Worksheet Functions 3 April 27th 11 12:52 PM
How do I write an array to include all worksheets in a workbook? Jodie Excel Worksheet Functions 8 October 13th 09 04:06 PM
write array to range muster Excel Programming 5 June 22nd 06 11:41 PM
Write 1st and 2nd dimension array values to cells [email protected] Excel Programming 2 February 28th 06 11:17 PM
Write to Array from other closed Excel file Dave B[_4_] Excel Programming 5 October 1st 03 04:48 PM


All times are GMT +1. The time now is 04:03 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"