1。区域1的范围C6:N15
2。区域1的范围C19:N28
3。将名称相同的,数量加到区域2对应名称的数量中
详细见文件http://pan.baidu.com/s/1eQ6TOn4
EXCEL 给相同内容叠加数量
答案:1 悬赏:20 手机版
解决时间 2021-03-04 05:57
- 提问者网友:十年饮冰
- 2021-03-03 18:33
最佳答案
- 五星知识达人网友:大漠
- 2021-03-03 19:05
Sub s()
Set d = CreateObject("scripting.dictionary")
For i = 3 To 13 Step 2
For j = 6 To 15
If Cells(j, i) <> "" Then d(Cells(j, i).Text) = d(Cells(j, i).Text) + Val(Cells(j, i + 1))
Next
Next
For i = 3 To 13 Step 2
For j = 19 To 28
If Cells(j, i) <> "" Then Cells(j, i + 1) = d(Cells(j, i).Text) + Cells(j, i + 1)
Next
Next
End Sub
Set d = CreateObject("scripting.dictionary")
For i = 3 To 13 Step 2
For j = 6 To 15
If Cells(j, i) <> "" Then d(Cells(j, i).Text) = d(Cells(j, i).Text) + Val(Cells(j, i + 1))
Next
Next
For i = 3 To 13 Step 2
For j = 19 To 28
If Cells(j, i) <> "" Then Cells(j, i + 1) = d(Cells(j, i).Text) + Cells(j, i + 1)
Next
Next
End Sub
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯