0

I simply have the issue that I need to create an array with a number of arrays. the problem is that the number of the arrays are only known at runtime. so, how can initialize (create) the array with the correct size?

Thanks a lot!

Community
  • 1
  • 1
JFS
  • 2,992
  • 3
  • 37
  • 48

1 Answers1

1

As per Ron's comment, use variables to set your array when it is known.

Dim lngRow As Long
Dim lngCol As Long
Dim X()
lngRow = 100
lngCol = 15
ReDim X(1 To lngCol, 1 To lngRow)
brettdj
  • 54,857
  • 16
  • 114
  • 177
  • Thanks for your help. I didn't want to use matrix arrays before but it might help me. I need to figure that out. Anyway, I found another question with [well described solutions](http://stackoverflow.com/questions/9435608/how-do-i-set-up-a-jagged-array-in-vba). Give me some time to understand the difference between those and your solutions. Thank you so far. – JFS Jun 04 '14 at 07:52
  • 1
    I could find a way to use the matrix array effectively. Thanks for the help. – JFS Jun 08 '14 at 23:43