[Solved] Remove duplicate rows Excel VBA


Here is an example that does this.

Make sure you run it with the sheet you want to use up:

Sub DeleteDupes()
Dim x
For x = Cells(Rows.CountLarge, "D").End(xlUp).Row To 1 Step -1
    If Cells(x, "D") = Cells(x, "E") Then
        'This line deletes the row:
        Cells(x, "D").EntireRow.Delete xlShiftUp
        'This line highlights the row to show what would be deleted;
        'Cells(x, "D").EntireRow.Interior.Color = RGB(230, 180, 180)
    End If
Next x
End Sub

Results of highlighting:

Results

Results of Delete:

Results2

0

solved Remove duplicate rows Excel VBA