Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 99
Default How do you create an Array of Arrays?

Hi

Use simply a single multi-dimensional array:
Dim Data(days,parameters+1) As Variant
creates an array, where in Data(1,1) to Data(days,1) you can store all your
dates, and in Data(n,2) to Data(n,parameters+1) you can store all parameters
for n-th date. You can visualize it as a table
Date, Parameter1, Parameter2, ...


Arvi Laanemets


"BFike" wrote in message
...
I have an array, Dates(), which I want to contain arrays of Days().

Thus Jan 1, 2006 is a Day which I then want to store in Dates.

So Dates(1) would store all of the associated information for that Day.

Here
is the code that I have now. I do not consider myself to be a good

programmer
by any means so suggestions are welcome.

The Arrays, limit, and dayz are all public.

Here is the code where I load the Array of Arrays:

Range("F28").Select
Set myRange = Range("F28")
ReDim Dates(1 To dayz)
For j = 1 To dayz
ReDim Days(1 To limit)
Dates(j) = Days()
For i = 1 To limit
Days(i) = ActiveCell.Value
ActiveCell.Offset(1, 0).Activate
Next i
myRange.Offset(0, j).Activate
Next j

Here is the code where I try to do something sum up the values and then
write to the sheet but I keep getting the same Days array values over and
over.

Sub Sum_Days_Region()

Dim i, x, a, j As Variant
Dim sum()

Sheets("Total").Select
Range("A406").Select
Range(Selection, Selection.End(xlDown)).Select
ReDim sum(1 To dayz)

For Each x In Selection
For j = 1 To dayz
Dates(j) = Days()
For i = 1 To limit
If District(i) & " - " & Brand(i) = x.Value Then
sum(j) = sum(j) + Days(i)
End If
Next i
Next j

Range(x.Address).Select
ActiveCell.Offset(0, 28).Activate
For a = 1 To dayz
ActiveCell.Value = sum(a)
ActiveCell.Offset(0, 1).Activate
sum(a) = 0
Next a

Next x

End Sub




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 Access Array of Arrays? billbell52 Excel Programming 1 February 24th 05 06:05 PM
Array of Public Arrays Hari Prasadh Excel Programming 1 January 21st 05 03:42 PM
array of arrays stored in Name: POSSIBLE? [email protected][_2_] Excel Programming 1 December 21st 04 10:55 PM
Array of Arrays in VBA Peter[_49_] Excel Programming 0 November 9th 04 09:50 PM
Extracting sub arrays from a 2-D VBA array Alan Beban[_2_] Excel Programming 7 August 16th 04 09:50 PM


All times are GMT +1. The time now is 03:10 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"