1800格放sumif, 若還是會卡, 用字典及array較快~~
矇著寫~~~~
Sub TEST_01()
Dim Arr, Crr, xD, R&, C&, T$
Set xD = CreateObject("Scripting.Dictionary")
Arr = [銷貨明細!B2:O500]
For R = 1 To UBound(Arr)
T = Arr(R, 1)
If T <> "" Then xD(T) = xD(T) + Val(Arr(R, 14))
Next R
Arr = [銷貨總數!A1:AM64]
Crr = [銷貨總數!J5:AM64]
For R = 5 To UBound(Arr)
For C = 10 To UBound(Arr, 2)
Crr(R - 4, C - 9) = xD(Arr(1, C) & Arr(R, 1))
Next C
Next R
[銷貨總數!J5:AM64] = Crr
End Sub