Live Demo

Arrays, Dictionaries & Collections

Static arrays, dynamic arrays, and the Dictionary object

Static Array

Fixed-size array with Dim statement.

IndexValue
0Red
1Green
2Blue
3Yellow
4Purple

Dynamic Array

Use ReDim Preserve to resize while keeping data.

Before ReDim: UBound = 2

First | Second | Third |

After ReDim Preserve: UBound = 4

First | Second | Third | Fourth | Fifth |

Multi-Dimensional Array

2D arrays for tabular data.

A1 B1 C1
A2 B2 C2
A3 B3 C3

Dictionary Object

Key-value store using Scripting.Dictionary.

Current entries: 0

Dictionary is empty.

Clear Dictionary
Dictionary cleared.

Array Helper Functions

UBound(arr)2 (last valid index)
LBound(arr)0 (first valid index)
IsArray(arr)True
Join(arr, ", ")dog, cat, bird
Split("a,b,c", ",")a + b + c
Array("x", "y", "z")x, y, z