The solution that I usually use is to resize the array every time I add a new element to it. Thus, the final array will never have any unused entries.
ReDim aArray(-1)
For i = 1 To 10
ReDim Preserve aArray(UBound(aArray) + 1)
aArray(UBound(aArray)) = i
Next
MsgBox Join(aArray, "," & vbNewLine)
Another solution suggested by Carlos is to do this with a dictionary, which is probably a cleaner solution:
Set dic = CreateObject("Scripting.Dictionary")
dic.Add "Item1", ""
dic.Add "Item2", ""
dic.Add "Item3", ""
msgbox Join(dic.Keys, "," & vbNewLine)
Thanks Maciej