Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Can you store a value in different levels of a multi array?
I'm working with arrays, and I thought that I could store the names for
(let's say) rows in level one of the array, and then have stored values in the second level. But it seems that the only place to store values is the last level of the array. Does that means that I have to keep a second array with the names for first level elements? Moreover, if I need "redim preserve" it looks that I can't add a second dimension to one dimensional array. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Can you store a value in different levels of a multi array?
Consider a user-defined data type. An example follows.
'declarations Type Customer Name as String Purchase() As Single End Type Sub Main() Dim tCust(1 to 2) As Customer tCust(1).Name = "Bill" ReDim tCust(1).Purchases(1 to 2) tCust(1).Purchase(1) = 20.25 tCust(1).Purchase(2) = 29.00 End Sub Hth, Merjet |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Can you store a value in different levels of a multi array?
Gerardo wrote:
I'm working with arrays, and I thought that I could store the names for (let's say) rows in level one of the array, and then have stored values in the second level. But it seems that the only place to store values is the last level of the array. Does that means that I have to keep a second array with the names for first level elements? Not clear what you mean by "the only place to store values is the last level of the array"? Moreover, if I need "redim preserve" it looks that I can't add a second dimension to one dimensional array. If the functions in the freely downloadable file at http://home.pacbell.net/beban are available to your workbook arr = TwoD(arr) Alan Beban |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Store array ??? | Excel Worksheet Functions | |||
match in multi-column and multi-row array | Excel Discussion (Misc queries) | |||
How Do You Take Data Off A Sheet and Store It In An Array | Excel Programming | |||
Lookup and store in array | Excel Programming | |||
Trying To Store Shapes/Objects to an array ?? | Excel Programming |