可以。
Sub zd()
[H2:M65535].ClearContents
n = [a65535].End(xlUp).Row
Cells(2, "H") = Cells(2, "A")
Cells(2, "I") = Cells(2, "B")
Cells(2, "L") = Cells(2, "E")
Cells(2, "M") = Cells(2, "F")
k = 2
For i = 3 To n
found = 0
For j = 2 To k
If Cells(i, "A") = Cells(j, "H") And Cells(i, "B") = Cells(j, "I") Then
found = 1
Exit For
End If
Next j
If found = 0 Then
k = k + 1
Cells(k, "H") = Cells(i, "A")
Cells(k, "I") = Cells(i, "B")
Cells(k, "L") = Cells(i, "E")
Cells(k, "M") = Cells(i, "F")
End If
Next i
For i = 2 To n
found = 0
For j = 2 To k
If Cells(i, "A") = Cells(j, "H") And Cells(i, "B") = Cells(j, "I") Then
Cells(j, "J") = Cells(j, "J").Value + Cells(i, "C").Value
Cells(j, "K") = Cells(j, "K").Value + Cells(i, "D").Value
End If
Next j
Next i
End Sub
