If you declare an array with Dim a(5) then the array has six elements: a(0) a(1) ... a(5).
When you refer to a(x) the index variable x must be in the range 0 to 5.
Anything else is an 'out of bounds' error.
When you refer to a(x) the index variable x must be in the range 0 to 5.
Anything else is an 'out of bounds' error.