|
- Sub test()
- Set d = CreateObject("scripting.dictionary")
- arr = Range(Cells(2, 4), Cells(Rows.Count, "h").End(3))
- For i = 1 To UBound(arr)
- d(arr(i, 5)) = d(arr(i, 5)) + arr(i, 1)
- Next
- Cells(2, "m").Resize(d.Count, 1) = Application.Transpose(d.keys)
- Cells(2, "n").Resize(d.Count, 1) = Application.Transpose(d.items)
- End Sub
复制代码 |
|