hi rxk. it would be good to upload an excel sample so that we don't have to manually key on our own to test. i have filled up just the essential information and you may try this:
Sub test()
Cells(1, 1).CurrentRegion.Sort key1:=Cells(1, "C"), order1:=xlAscending, key2:=Cells(1, "G"), order2:=xlAscending, Header:=xlYes
LR = Cells(Rows.Count, 1).End(xlUp).Row
For RowX = LR To 2 Step -1
If Cells(RowX, "C") = Cells(RowX - 1, "C") And Cells(RowX, "G") = Cells(RowX - 1, "G") Then
If Cells(RowX, "F") <> vbNullString Then
Cells(RowX - 1, "F") = Cells(RowX - 1, "F") + Cells(RowX, "F")
Else
Cells(RowX - 1, "E") = Cells(RowX - 1, "E") + Cells(RowX, "E")
End If
Rows(RowX).Delete
End If
Next
End Sub
Bookmarks