在窗体中添加一个命令按钮(其 Name属性为Command1),然后编写如下代码: Private Sub Command1_Click() Dim n() As Integer Dim a, b As Integer Dim k As Integer a = InputBox("Enter the first number") b = InputBox("Enter the second number") ReDim n(a To b) For k = LBound(n, 1) To UBound(n, 1) n(k) = k Print n(k) Next k End Sub 程序运行后,单击命令按钮,在输入对话框中分别输入 2和3,输出结果为__ __