How can I delete duplicate rows in Microsoft Excel 2011?

Solution 1:

This answer assumes:

  • you have a header row and, because of that, the first row containing your data is Row 2.

Solution

  1. Open the Excel spreadsheet in its original state (i.e. All duplicate rows are adjacent to each other)
  2. Go to Tools > Macro > Visual Basic Editor
  3. This will bring up a Project window with the name of your first sheet highlighted - Double-click on the sheet name
  4. In the code window that appears, enter the code below (you should be able to just copy & paste it)

    Sub DeleteEverySecondRow()
        For i = Cells(Rows.Count, "a").End(xlUp).Row To 2 Step -2
            Rows(i).Delete
        Next i
    End Sub
    
  5. Close the window and return back to your spreadsheet

  6. Now go to Tools > Macro > Macros…
  7. In the Macro window that appears, select the DeleteEverySecondRow macro and click on the Run button
  8. Now wait a while for the macro to finish (how long it takes depends on how many rows you have - but it should take no more than a few minutes at most)
  9. After it’s finished every second row will be deleted

Any problems, please let me know.

NOTE

I've answered this question on the basis of the original title and the requirement you've specified (i.e. to delete every second row). However, keep in mind that if you've sorted the data in such a way that you're duplicate rows are no longer adjacent to each other, then this macro will not achieve what you actually need.