|
Sub testbylongwin()
Arr = [a1].CurrentRegion
Set d = CreateObject("scripting.dictionary")
Set d1 = CreateObject("scripting.dictionary")
For i = 3 To UBound(Arr)
If Not d.exists(Arr(i, 1)) Then
d(Arr(i, 1)) = Arr(i, 2)
Else
d(Arr(i, 1)) = d(Arr(i, 1)) & "/" & Arr(i, 2)
End If
Next
For Each k In d.keys
d1.RemoveAll
If InStr(1, d(k), "/") > 0 Then
brr = Split(d(k), "/")
For j = 0 To UBound(brr)
d1(brr(j)) = 1
Next
d(k) = Join(d1.keys, "/")
End If
Next
[d3].Resize(d.Count, 2) = Application.Transpose(Array(d.keys, d.items))
Set d = Nothing
Set d1 = Nothing
End Sub
|
评分
-
1
查看全部评分
-
|