使用InputBox函數為數組中的所有元素賦值?
Dim a(1 To 20) As IntegerPrivate Sub Form_Click() mx = a(1) mn = a(1)For i = 1 To 20 a(i) = InputBox("輸入一個數值", "輸入"
) If a(i) > mx Then mx = a(i) If a(i) < mn Then mn = a(i)NextPrint "最大值是" & mx & ",最小值是" & mnEnd Sub
使用InputBox函數為數組中的所有元素賦值?
Dim a(1 To 20) As IntegerPrivate Sub Form_Click() mx = a(1) mn = a(1)For i = 1 To 20 a(i) = InputBox("輸入一個數值", "輸入"
) If a(i) > mx Then mx = a(i) If a(i) < mn Then mn = a(i)NextPrint "最大值是" & mx & ",最小值是" & mnEnd Sub