View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
billbell52 billbell52 is offline
external usenet poster
 
Posts: 5
Default How to Access Array of Arrays?

I have a variant array (vVal) that contains an arrays of type single.
In the for loop I (1) redim to 0, (2) extend array by 1, (3)
set value in array. The code I have there is wrong but sort of
shows what I am trying to do.


Dim v1() As Single
Dim v2() As Single
Dim v3() As Single
Dim vKey() As Variant
Dim vVal() As Variant
Dim i As Integer, k As Integer, j As Integer
Dim m As Integer

vKey = Array("VOLTAGES", "TEMPERATURES", "ROWS", "COLS",
"SENSE_AMPS")
vVal = Array(v1(), v2(), v1(), v2(), v3())
' Loop to test access
For i = 0 To UBound(vVal)
ReDim vVal(i)(0) ' Redim to 0
ReDim Preserve vVal(i)(UBound(vVal(i) + 1)) ' Add 1 item to array
vVal(i)(UBound(vVal(i)) = 125 ' Set value
Next i