Option Explicit
Sub TEST()
Dim Brr, Crr, Z, i&, R&, T$
Set Z = CreateObject("Scripting.Dictionary")
Brr = Range([D3], [A65536].End(xlUp))
ReDim Crr(1 To UBound(Brr), 1 To 1)
For i = UBound(Brr) To 1 Step -1
T = Brr(i, 1) & "|" & Brr(i, 2): R = Z(T)
If R = 0 Then R = i: Z(T) = R
Crr(R, 1) = Crr(R, 1) + Brr(i, 4)
Next
[G3].Resize(UBound(Crr)) = Crr
End Sub作者: hcm19522 時間: 2024-1-5 14:04