値を残したまま配列を再定義するメモ。
common.bas
Dim arr() As String
'配列を再定義
ReDim arr(0 To 2)
arr(0) = "A"
arr(1) = "B"
arr(2) = "C"
'値を残したまま配列を再定義
ReDim Preserve arr(0 To 3)
arr(3) = "D"
MsgBox arr(0) & " : " &arr(1) & " : " & arr(2) & " : " & arr(3)
- 参考文献
Office VBA Reference