用VBA数组和字典 做两种分类汇总
答案:1 悬赏:60 手机版
解决时间 2021-04-01 22:44
- 提问者网友:浩歌待明月
- 2021-04-01 14:12
用VBA数组和字典 做两种分类汇总
最佳答案
- 五星知识达人网友:第四晚心情
- 2021-04-01 15:26
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透视表录制宏就行了
来自:求助得到的回答
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯