关于 vba 字典的问题
答案:1 悬赏:70 手机版
解决时间 2021-03-23 16:43
- 提问者网友:骨子里的高雅
- 2021-03-23 11:47
关于 vba 字典的问题
最佳答案
- 五星知识达人网友:人间朝暮
- 2021-03-23 12:24
对A列去重,且汇总
设置下变量类型,试下
Sub test()
Dim I As Long
Set d = CreateObject("scripting.dictionary")
arr = Range("a1", Cells(Rows.Count, 2).End(xlUp))
For I = 1 To UBound(arr)
d(arr(I, 1)) = d(arr(I, 1)) + arr(I, 2)
Next
[e1].Resize(d.Count) = Application.Transpose(d.keys)
[f1].Resize(d.Count) = Application.Transpose(d.items)
End Sub
设置下变量类型,试下
Sub test()
Dim I As Long
Set d = CreateObject("scripting.dictionary")
arr = Range("a1", Cells(Rows.Count, 2).End(xlUp))
For I = 1 To UBound(arr)
d(arr(I, 1)) = d(arr(I, 1)) + arr(I, 2)
Next
[e1].Resize(d.Count) = Application.Transpose(d.keys)
[f1].Resize(d.Count) = Application.Transpose(d.items)
End Sub
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯