|
- Sub Macro1()
- Dim arr, brr, d, i&, p$$, j%, s&
- Set d = CreateObject("scripting.dictionary")
- arr = Range("a1").CurrentRegion
- [n:q] = ""
- n = UBound(arr, 2): s = 1
- For i = 1 To UBound(arr)
- p = ""
- For j = 1 To n
- p = p & "," & arr(i, j)
- Next
- If Not d.exists(p) Then
- d(p) = i
- Else
- d(p) = d(p) & "," & i
- End If
- Next
- b = d.items
- For i = 0 To d.Count - 1
- If InStr(b(i), ",") Then
- x = Split(b(i), ",")
- Cells(s, "n").Resize(UBound(x) + 1, n) = Cells(x(0), 1).Resize(1, n).Value
- End If
- s = Range("n65536").End(xlUp).Row + 2
- Next
- End Sub
复制代码 |
|