Array limit

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

Is there any limit on the number of items that can be
loaded into an array?

I'm looking at creating an array that has 2,500 - 3,000
records with 5 fields in each record? Will this cause me
any problems later in the macro?

Thanks
 
Hi Mike
just test it for yourself :-)

Sub array_max()
Dim testarr(3000, 5)
Dim i
Dim j
For i = 0 To 3000
For j = 0 To 5
testarr(i, j) = "Element: " & i & "/" & j
Next
Next
MsgBox testarr(2500, 3)
End Sub
 
Only possibly in terms of speed, ie it may slow you down a bit - depends on lots
of factors. Main limit is that you cannot have more than 65,535 cells in a
single dimension, so cannot use whole column references, though it is porobably
better to look at a dynamic range anyway which will be smaller and possibly more
efficient.
 
Back
Top