可以写的再啰嗦一点吗?- Sub qq()
- Dim d, i%, arr, k, t, aa, brr()
- Set d = CreateObject("scripting.dictionary")
- arr = Range("A1").CurrentRegion
- For i = 2 To UBound(arr)
- d(arr(i, 1)) = d(arr(i, 1)) & "," & i
- Next
- For Each aa In d.keys
- If UBound(Split(d(aa), ",")) = 1 Then d.Remove (aa)
- Next
- k = d.keys: t = d.items
- ReDim brr(1 To d.Count, 1 To 3)
- For i = 1 To d.Count
- brr(i, 1) = k(i - 1)
- brr(i, 2) = UBound(Split(t(i - 1), ","))
- brr(i, 3) = Mid(t(i - 1), 2)
- Next
- [I1].CurrentRegion.Offset(4).Clear
- [I5].Resize(d.Count, 3) = brr
- End Sub
复制代码 |