1,451
社区成员
发帖
与我相关
我的任务
分享
Dim I As Integer, J As Integer
With M
For I = 1 To .Rows - 1
If .TextMatrix(I, 3) <> 0 Then
For J = I + 1 To .Rows - 1
If .TextMatrix(J, 3) = .TextMatrix(I, 3) Then
If Val(.TextMatrix(J, 1)) > Val(.TextMatrix(I, 1)) Then .TextMatrix(I, 1) = .TextMatrix(J, 1)
.TextMatrix(I, 2) = Val(.TextMatrix(I, 2)) + Val(.TextMatrix(J, 2))
.TextMatrix(J, 0) = "-1"
End If
Next J
End If
Next I
For I = .Rows - 1 To 1 Step -1
If .TextMatrix(I, 0) = "-1" Then .RemoveItem I
Next I
End With