读者您好:
你借鉴下下面的代码。
Private Sub Form_Load()
Dim a(4) As Integer
a(0) = 0
a(1) = 1
a(2) = 2
a(3) = 3
For i = 0 To UBound(removearray(a, 2)) - 2
Debug.Print removearray(a, 2)(i)
Next
End Sub
Private Function removearray(a() As Integer, index As Integer)
j = 0
For i = 0 To UBound(a) - 1
If i <> index Then
a(j) = a(i)
j = j + 1
End If
Next
removearray = a()
End Function