Sub TEST()
Dim Arr, xD, i&, T$, U&, N&
Set xD = CreateObject("Scripting.Dictionary")
Arr = Range([B1], [I65536].End(xlUp))
Arr(1, 2) = "點數加總"
For i = 2 To UBound(Arr)
T = Arr(i, 1): U = xD(T): Arr(i, 2) = ""
If U = 0 Then N = N + 1: U = N: xD(T) = N
Arr(U + 1, 1) = Arr(i, 1)
Arr(U + 1, 2) = Val(Arr(U + 1, 2)) + Val(Arr(i, 8))
Next i
[M:N].ClearContents
With [M1:N1].Resize(N + 1): .Value = Arr: .Borders.LineStyle = 1: End With
End Sub作者: prince0413 時間: 2018-11-30 14:48