|
Sub 向数组中指定的位置写入数据()
Dim arr(1 To 9)
arr(3) = "我"
arr(5) = "是"
arr(7) = "谁"
End Sub
Sub 循环向数组中写入数据()
Dim arr(1 To 4)
For Each Rng In [a1:a4]
n = n + 1
arr(n) = Rng
Next
End Sub
Sub 常量数组数据写入一般数组()
Dim arr()
arr = Array("V", "B", "A", 9)
End Sub
Sub 单元格区域数据批量写入数组()
arr = Application.Transpose([a1:a4]) '注意:当向数组中批量写入多行,结果就是二维数组
arr1 = Application.Transpose(Application.Transpose([a7:d7]))
End Sub
|
|