说明(2017.3.25):
1. 知识点为dim arr2(1 to 1000, 1 to 4)先定义一个足够大的二维数组,不然后面需要transpose转置成一维数组。
'抽取列表中叫“虹虹”的所有信息,设置arr2数组1到1000,可以省略转置步骤
Public Sub test1()
Dim arr, arr2( To , To ), k
arr = Range("a1:d5")
' MsgBox (UBound(arr))
' Stop
For i = To UBound(arr, )
If arr(i, ) = "虹虹" Then
k = k +
arr2(k, ) = arr(i, )
arr2(k, ) = arr(i, )
arr2(k, ) = arr(i, )
arr2(k, ) = arr(i, )
Cells(i, ) = "这个"
End If
Next
Range("a" & ( + i)).Resize(k, ) = arr2
End Sub