引用:http://zhidao.baidu.com/question/27453999.html
Private Sub Command1_Click() Dim n(1 To 100) As Integer num = InputBox("请输入数组元素个数", "输入框") Print "原始数组为:" For i = 1 To num n(i) = i * 5 + 1 Print n(i); Next Print lp: m = InputBox("请选择要删除元素的位置", "输入框") num = num - 1 For i = m To num n(i) = n(i + 1) Next Print "删除元素后数组变为:" For i = 1 To num Print n(i); Next Print If MsgBox("是否继续删除?点击“确定”继续。", 1) = vbOK Then GoTo lp End Sub