ReDim Statement

  1. ReDim varname(subscripts)[As Type][,varname(subscripts)]

Used to declare dynamic arrays and reallocate storage space.

The ReDim statement is used to size or resize a dynamic array that has already been declared using the Dim statement with empty parentheses. You can use the ReDim statement to repeatedly change the number of elements in and array but not to change the number of dimensions in an array or the type of the elements in the array.

ReDim only works with single dimensional arrays. Multi-dimensional arrays, like ReDim MyArray (3,5), are invalid.

More:

Example: