Sub mysub()
Dim start As Double
start = Timer
Columns(3) = ""
Columns(4) = ""
Application.ScreenUpdating = False
Dim beginrow As Integer: beginrow = 1
Dim endrow As Long: endrow = Cells(Rows.Count, 1).End(xlUp).Row
Dim sumvalue As Long
Dim duibizhi As String
Dim k: k = 1
For i = beginrow To endrow
sumvalue = 0
If Cells(i, 1) <> "" And Cells(i, 2) > 0 Then
If Application.WorksheetFunction.CountIf(Columns(1), Cells(i, 1)) > 1 Then '---判断 是否重复
duibizhi = Cells(i, 1)
For j = i To endrow '----重复值SUM
If Cells(j, 1) = duibizhi Then
'MsgBox i
sumvalue = sumvalue + Cells(j, 1).Offset(0, 1)