Try
Sub test426U()
Dim k&, i&, r&, c As Double, s As Double, j&
Dim d As Object
Set d = CreateObject("Scripting.Dictionary")
k = 1
For i = Cells(Rows.Count, 1).End(xlUp).Row To 1 Step -1
If Not d.exists(Cells(i, 1).Value) Then
d.Add Cells(i, 1).Value, k
k = k + 1
Else
For j = Cells(i, 1).Row To Cells(Rows.Count, 1).End(xlUp).Row
If Cells(i, 1).Value = Cells(j, 1).Value Then
s = Cells(j, 2).Value
r = Cells(j, 1).Row
End If
Next j
c = Cells(i, 2).Value - s
Cells(r, 1).EntireRow.Delete
Cells(i, 2).Value = c
End If
Next i
End Sub
Bookmarks