Jagged arrays - Cannot Define with Arr1()() as integer = New integ

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

On MS site, it says use the following to define Jagged arrays:
Arr1()() as Double = New Double()() {}
how come it doesn't seem to work in Excel's VB?
 
Post the URL for this citation.

Is it for VB6? To the best of my knowledge, VB6 doesn't use any notation
like that.

If it isn't about VB6, then there's your huckleberry.
 
The page clearly states -

"This page is specific to
Microsoft Visual Studio 2005/.NET Framework 2.0"

which is not VB/VBA and makes Tom's huckleberry comment highly apposite.

But I can see why you may have been misled into thinking otherwise when the
page is also titled "Visual Basic Language Concepts".

Regards,
Peter T
 
As others have pointed out, that is not VB/VBA code.
Something like this maybe:

Private Sub CommandButton1_Click()
Dim arrAll As Variant
Dim i As Long
Dim TempStr As String

Const MAX_ENTRIES As Long = 10

ReDim arrAll(1 To MAX_ENTRIES)

For i = 1 To MAX_ENTRIES
TempStr = Application.WorksheetFunction.Rept("Text,", Rnd() * 50)
arrAll(i) = Split(TempStr, ",")
Next

Dim j As Long

For i = LBound(arrAll) To UBound(arrAll)
For j = LBound(arrAll(i)) To UBound(arrAll(i))
Debug.Print i, j, arrAll(i)(j)
Next 'j
Next 'i

End Sub

NickHK
 
Thanks for clearing things up. I'm very new to this so this VB/VBA, Visual
Studio, .Net concepts look like colored marbles to me.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top