|
- Sub 一键查找复制()
- Dim d As Object, arr, i&
- Set d = CreateObject("scripting.dictionary")
- arr = Sheet1.UsedRange
- For i = 1 To UBound(arr)
- If InStr(arr(i, 9), "】") > 0 Then
- d((arr(i, 8)) & Left(arr(i, 9), WorksheetFunction.Find("】", arr(i, 9)))) = arr(i, 8) & "|" & Left(arr(i, 9), WorksheetFunction.Find("】", arr(i, 9)))
- End If
- Next
- ReDim brr(1 To d.Count, 1 To 2)
- For i = 0 To d.Count - 1
- ss = d.Items
- temp = Split(ss(i), "|")
- brr(i + 1, 1) = temp(0)
- brr(i + 1, 2) = temp(1)
- Next
- Sheet2.Range("B2:C10000").ClearContents
- Sheet2.Range("B2").Resize(d.Count, 2) = brr
- Set d = Nothing
- End Sub
复制代码
我也练习一下, |
|