Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim myArray(90) As Long
Dim myTempArray() As Long
Dim intCount As Integer
'Populate some values into the array.
For intCount = 0 To 89
myArray(intCount) = CLng(intCount)
Next
'To upsize the array bounds
'First set the temp to the same size as original array.
ReDim myTempArray(90)
'Copy the original array to the temp.
myArray.CopyTo(myTempArray, 0)
'Erase original array and redim it.
Erase myArray
ReDim myArray(900)
'Copy the temp array back into the original (now upsized) array.
myTempArray.CopyTo(myArray, 0)
'This just shows when it is done and that the original contents
'have been copied back. Also shows that the added
'dimensions are initialized to 0.
MessageBox.Show("Done")
For intCount = 0 To 110 Step 10
MessageBox.Show(myArray(intCount).ToString())
Next
End Sub