|
如果要全部求得,要进行x中的组合
- Sub yy1()
- Dim i&, Myr&, Arr, j&
- Dim d, k, t, x
- Set d = CreateObject("Scripting.Dictionary")
- Sheet1.Activate
- Myr = [a65536].End(xlUp).Row
- Arr = Range("a1:t" & Myr)
- ReDim Arr1(1 To Myr - 1)
- For i = 2 To UBound(Arr)
- x = Arr(i, 2) & "|" & Arr(i, 3) & "|" & Arr(i, 4) & "|" & Arr(i, 6) & "|" & Arr(i, 7) & "|" & Arr(i, 10) & "|" & Arr(i, 11) & "|" & Arr(i, 13) & "|" & Arr(i, 14) & "|" & Arr(i, 15) & "|" & Arr(i, 16) & "|" & Arr(i, 17) & "|" & Arr(i, 18) & "|" & Arr(i, 19) & "|" & Arr(i, 20)
- d(x) = d(x) & Arr(i, 1) & ","
- Next
- k = d.keys
- t = d.items
- d.RemoveAll
- For i = 0 To UBound(t)
- t(i) = Left(t(i), Len(t(i)) - 1)
- If InStr(t(i), ",") Then
- d(t(i)) = ""
- End If
- Next
- k = d.keys
- [aa1].Resize(d.Count, 1) = Application.Transpose(k)
- End Sub
复制代码 |
|