汇总数据,按照类型合并数据@TOC
java
Sub yy()
Dim Arr, i&, d, Myr&
Set d = CreateObject("Scripting.Dictionary")
[c2:d65535].Clear
Myr = [a65536].End(xlUp).Row
Arr = Range("a1:c" & Myr)
For i = 2 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
k = d.keys
t = d.items
[c2].Resize(d.Count, 1) = Application.Transpose(k)
[d2].Resize(d.Count, 1) = Application.Transpose(t)
End Sub# 欢迎使用Markdown编辑器