展开全部
Sub s()
arr = [a1].CurrentRegion
Set d1 = CreateObject("scripting.dictionary")
Set d2 = CreateObject("scripting.dictionary")
For i = 1 To UBound(arr)
d1(arr(i, 1) & " " & arr(i, 2)) = d1(arr(i, 1) & " " & arr(i, 2)) + arr(i, 3)
d2(arr(i, 1) & " " & arr(i, 2)) = d2(arr(i, 1) & " " & arr(i, 2)) + arr(i, 4)
Next
i = 0
For Each k In d1.Keys
i = i + 1
Cells(i, 7).Resize(, 2) = Split(k)
Cells(i, 9) = d1(k)
Cells(i, 10) = d2(k)
Next
End Sub
来自:求助得到的回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询