用VBA数组和字典 做两种分类汇总
用VBA数组和字典做两种分类汇总
答案:1 悬赏:60 手机版
解决时间 2021-12-20 08:52
- 提问者网友:趣果有间
- 2021-12-19 14:54
最佳答案
- 五星知识达人网友:冷風如刀
- 2021-12-19 15:57
Sub s()
arr = [a1].CurrentRegion
Set d = CreateObject("scripting.dictionary")
For i = 2 To UBound(arr)
d(arr(i, 2)) = d(arr(i, 2)) + arr(i, 3)
Next
[e1].Resize(d.Count) = Application.Transpose(d.keys)
[f1].Resize(d.Count) = Application.Transpose(d.items)
End Sub透视表录制宏就行了
arr = [a1].CurrentRegion
Set d = CreateObject("scripting.dictionary")
For i = 2 To UBound(arr)
d(arr(i, 2)) = d(arr(i, 2)) + arr(i, 3)
Next
[e1].Resize(d.Count) = Application.Transpose(d.keys)
[f1].Resize(d.Count) = Application.Transpose(d.items)
End Sub透视表录制宏就行了
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯