Sum column E and F if A & C & D is same
Let's say row 2 & 3 meet the criteria, E3 & F3 sum into E2 & F2, then delete row 3, loop till last row.
Thanks for helping.
Let's say row 2 & 3 meet the criteria, E3 & F3 sum into E2 & F2, then delete row 3, loop till last row.
Thanks for helping.
Code:
Sub test()
RowCount = 1
Do While Range("A" & RowCount) <> ""
If Range("A" & RowCount) = Range("A" & (RowCount + 1)) And _
Range("C" & RowCount) = Range("C" & (RowCount + 1)) And _
Range("D" & RowCount) = Range("D" & (RowCount + 1)) Then
Range("E" & RowCount) = Range("E" & RowCount) + _
Range("E" & (RowCount + 1))
Range("F" & RowCount) = Range("F" & RowCount) + _
Range("F" & (RowCount + 1))
Rows(RowCount + 1).Delete
Else
RowCount = RowCount + 1
End If
Loop
End Sub