Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 783
Default 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
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
Store array ??? piero Excel Worksheet Functions 4 September 16th 09 04:39 PM
match in multi-column and multi-row array sloth Excel Discussion (Misc queries) 14 September 1st 06 10:33 PM
How Do You Take Data Off A Sheet and Store It In An Array Raleigh Excel Programming 2 January 17th 06 08:47 PM
Lookup and store in array kanuvas[_7_] Excel Programming 1 November 9th 05 10:43 AM
Trying To Store Shapes/Objects to an array ?? Tom Ogilvy Excel Programming 2 September 21st 04 09:49 PM


All times are GMT +1. The time now is 04:33 PM.

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"