View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Bas Bas is offline
external usenet poster
 
Posts: 3
Default Dynamic array seems invalid

Hi all,

First of all, I'm a relative newbie when it comes to arrays. I tried
to generate a dynamic array , named 'ClusterValues()' . When I point
my mouse over 'Array(TStV4)' it seems(!) to be a valid array 'saying'
"1, 2, 3" , when I test this array using:

'Application.StatusBar = WorksheetFunction.Index(ClusterValues(), 1,
1)' , the whole array is printed within the status bar, but what wend
wrong?

Thanks in advance!

- Bas


Option Base 1
--
Sub test()

Dim ClusterMembers() As Variant
Dim ClusterValues() As Variant
Dim TBV As Byte
Dim TIV2 As Integer
Dim TIV4 As Integer
Dim TStV4 As String

For TIV4 = 1 To TBV - 1 Step 1
TStV4 = TStV4 & WorksheetFunction.Index(Range("A1").Offset(TIV2,
0).Range("A1:CS1"), 0, WorksheetFunction.Index(ClusterMembers(), 1,
TIV2)) & ", "
Next

TStV4 = TStV4 & WorksheetFunction.Index(Range("A1").Offset(TIV2,
0).Range("A1:CS1"), 0, WorksheetFunction.Index(ClusterMembers(), 1,
TBV))
ClusterValues() = Array(TStV4)

End Sub