本文为《别怕,Excel VBA其实特别简单(第3版)》随书问题参考答案
1、将1到100的自然数存入数组arr
Sub 将1到100的数存入数组()
Dim Arr(1 To 100) As Integer, i As Byte
For i = 1 To 100
Arr(i) = i
Next
End Sub
2、将活动工作表A1:A100中的数据存入数组brr
Sub 将区域中的数据存入数组()
Dim Brr(1 To 100), i As Byte
For i = 1 To 100
Brr(i) = Cells(i, "A").Value
Next i
End Sub