How to Remove Duplicate Rows in Excel: 3 Easy Ways
AuthorSiluvia•Last modified
Duplicate rows often appear when you copy data from different worksheets, import reports from external systems, or combine multiple lists in Excel. If they are not removed, these repeated records may affect totals, PivotTables, reports, and data analysis results.
In this tutorial, you will learn 3 practical ways to remove duplicate rows in Excel: using Excel’s built-in Remove Duplicates feature, using Kutools for Excel to select and review duplicate rows before deleting them, and using VBA to automate the task.

Why remove duplicate rows in Excel
A duplicate row means that the same record appears more than once in your worksheet. For example, the same order, customer, product, and amount may be repeated in a sales list.
| Order ID | Customer | Product | Amount |
|---|---|---|---|
| 1001 | Green Market | Laptop Stand | 85 |
| 1002 | Northline Co. | Keyboard | 45 |
| 1001 | Green Market | Laptop Stand | 85 |
| 1003 | Bright Office | Monitor | 220 |
| 1002 | Northline Co. | Keyboard | 45 |
In the example above, the records for Order ID 1001 and Order ID 1002 appear twice. Removing duplicate rows helps keep only one clean copy of each record.
Method 1: Remove duplicate rows with Excel Remove Duplicates
Excel has a built-in Remove Duplicates feature that can quickly delete repeated rows from a selected range. This method is best when you want to remove duplicates directly and keep the first occurrence of each record.
- Select the data range that contains duplicate rows.
- Go to the Data tab, and click Remove Duplicates in the Data Tools group.

- In the Remove Duplicates dialog box, set the options as follows:
- ① Check My data has headers if your selected range includes headers.
- ② Select the columns used to identify duplicates.
- If you select all columns, Excel removes only completely identical rows.
- If you select only one or some columns, Excel treats rows with the same values in those selected columns as duplicates.
- ③ Click OK.

- Excel will show a message box with the number of duplicate values removed and unique values remaining. Click OK to close it.

Result: Excel removes the duplicate rows from the selected range and keeps the first occurrence of each duplicate record.
Method 2: Select, highlight, and remove duplicate rows with Kutools
If you want to check duplicate rows before deleting them, Kutools for Excel provides an easier and safer way. With the Select Duplicate & Unique Cells feature, you can quickly select duplicate rows first, highlight them if needed, review them, and then delete them from the worksheet. This method is especially useful when you want to keep the first occurrence and remove only the extra duplicate rows.
- Select the range where you want to find and remove duplicate rows.
- Click Kutools > Select > Select Duplicate & Unique Cells.

- In the Select Duplicate & Unique Cells dialog box, do the following:
- ① Choose Each row in the Based on section.
- ② Under Rule, select Duplicates (Except 1st one).
- Duplicates (Except 1st one): selects only the extra duplicate rows and keeps one copy.
- All duplicates (Including 1st one): selects all rows in each duplicate group. If you delete them, all duplicate records in that group will be removed.
- ③ Optional: check Fill backcolor or Fill font color if you want to highlight the selected duplicate rows before deleting them.
- ④ Click OK.

- A message box appears and tells you how many rows have been selected. Click OK.

- Right-click one of the selected row numbers and choose Delete.
Result: The duplicate rows except the first occurrence are selected and deleted. One copy of each repeated record remains in the worksheet. If you applied a fill color or font color, the duplicate rows are highlighted before deletion, making them easier to review.
- Selects duplicate rows before deleting them, so you can review the results first
- Can highlight duplicate rows with fill color or font color for easier checking
- Keeps the first occurrence and selects only the extra duplicate rows
- Can select entire duplicate rows instead of only individual cells
- Provides a clear dialog box with easy-to-understand duplicate rules
- Safer than deleting duplicates directly when working with important data
- No formulas, helper columns, or VBA code required
Method 3: Remove duplicate rows with VBA
This VBA code checks duplicate rows based on all columns in the selected range. It keeps the first occurrence and deletes the later duplicate rows.
- Press Alt + F11 to open the Microsoft Visual Basic for Applications window.
- Click Insert > Module.
- Copy and paste the VBA code into the module window.
Sub RemoveDuplicateRows_KeepFirst() 'Updated by Extendoffice 2026/5/22 Dim rng As Range Dim hasHeaders As VbMsgBoxResult Dim firstDataRow As Long Dim r As Long, c As Long Dim key As String Dim seen As Collection Dim rowsToDelete As Range Dim cellValue As Variant On Error Resume Next Set rng = Application.InputBox("Select the range to remove duplicate rows:", "Remove Duplicate Rows", Type:=8) On Error GoTo 0 If rng Is Nothing Then Exit Sub hasHeaders = MsgBox("Does the selected range include headers?", vbYesNoCancel + vbQuestion, "Header Option") If hasHeaders = vbCancel Then Exit Sub If hasHeaders = vbYes Then firstDataRow = 2 Else firstDataRow = 1 End If Set seen = New Collection Application.ScreenUpdating = False For r = firstDataRow To rng.Rows.Count key = "" For c = 1 To rng.Columns.Count cellValue = rng.Cells(r, c).Value If IsError(cellValue) Then key = key & "[ERROR]" & CStr(rng.Cells(r, c).Text) & Chr(30) Else key = key & CStr(cellValue) & Chr(30) End If Next c On Error Resume Next seen.Add key, key If Err.Number <> 0 Then If rowsToDelete Is Nothing Then Set rowsToDelete = rng.Rows(r).EntireRow Else Set rowsToDelete = Union(rowsToDelete, rng.Rows(r).EntireRow) End If Err.Clear End If On Error GoTo 0 Next r If Not rowsToDelete Is Nothing Then rowsToDelete.Delete MsgBox "Duplicate rows have been removed.", vbInformation Else MsgBox "No duplicate rows were found.", vbInformation End If Application.ScreenUpdating = True End Sub - Press F5 or click the Run button in the VBA Editor to run the code.
- In the pop-up box, select the range where you want to remove duplicate rows. Click OK.

- When asked whether the selected range includes headers, choose Yes or No.

Result: Duplicate rows in the selected range are removed, and the first occurrence is kept.
Which method should you use
The best method depends on whether you want a quick built-in solution, a safer visual way to review duplicates first, or a code-based method.
| Method | Best for | Keeps first occurrence | Selects duplicate rows first | Can highlight duplicates | Difficulty |
|---|---|---|---|---|---|
| Excel Remove Duplicates | Quickly deleting duplicate rows | ✅ Yes | ❌ No | ❌ No | Easy |
| Kutools for Excel | Selecting, highlighting, reviewing, and deleting duplicate rows safely | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Very easy |
| VBA | Removing duplicate rows with code | ✅ Yes | ❌ No | ❌ No | Advanced |
For quick cleanup, Excel’s built-in Remove Duplicates feature works well. If you want to select, highlight, and review duplicate rows before deleting them, Kutools for Excel is the safer and more visual choice. VBA is useful when you prefer a code-based solution.
Frequently asked questions
How do I remove duplicate rows but keep the first one in Excel?
You can use Excel’s built-in Remove Duplicates feature. It removes repeated records and keeps the first occurrence. You can also use Kutools for Excel and choose Duplicates (Except 1st one) to select only the duplicate rows after the first occurrence.
How do I remove duplicate rows based on one column?
Select your data range, go to Data > Remove Duplicates, and select only the column you want to use for duplicate detection. Excel will treat rows with the same value in that column as duplicates and keep the first occurrence.
How can I find duplicate rows without deleting them?
Use Kutools for Excel’s Select Duplicate & Unique Cells feature. It allows you to select duplicate rows first. You can then review, highlight, copy, or delete them later.
What is the difference between Duplicates (Except 1st one) and All duplicates (Including 1st one)?
Duplicates (Except 1st one) selects only the repeated occurrences after the first record. This is useful when you want to keep one copy and remove the extra duplicates.
All duplicates (Including 1st one) selects every row in each duplicate group, including the first occurrence. This is useful when you want to identify all records that belong to duplicate groups.
Can I highlight duplicate rows before deleting them?
Yes. With Kutools for Excel, you can select duplicate rows and apply fill color or font color at the same time. This makes it easier to review duplicate records before deleting them.
Can Excel remove case-sensitive duplicate rows?
Excel’s built-in Remove Duplicates feature is not ideal for case-sensitive duplicate detection. If you need to distinguish between uppercase and lowercase text, you can use the Case sensitive option in Kutools for Excel’s Select Duplicate & Unique Cells feature.
Conclusion
Removing duplicate rows is an important step in cleaning Excel data. For a quick cleanup, Excel’s built-in Remove Duplicates feature works well. For a safer process, Kutools for Excel lets you select and review duplicate rows before deleting them. For repeated cleanup tasks, VBA can help automate the process.
If you often work with large datasets or need to check duplicates carefully before deleting them, the Kutools method can save time and reduce the risk of deleting important records by mistake.
Best Office Productivity Tools
Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time. Click Here to Get The Feature You Need The Most...
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
- Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
- Open and create multiple documents in new tabs of the same window, rather than in new windows.
- Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
All Kutools add-ins. One installer
Kutools for Office suite bundles add-ins for Excel, Word, Outlook & PowerPoint plus Office Tab Pro, which is ideal for teams working across Office apps.
- All-in-one suite — Excel, Word, Outlook & PowerPoint add-ins + Office Tab Pro
- One installer, one license — set up in minutes (MSI-ready)
- Works better together — streamlined productivity across Office apps
- 30-day full-featured trial — no registration, no credit card
- Best value — save vs buying individual add-in
Table of Contents
- Why remove duplicate rows in Excel
- Method 1: Remove duplicate rows with Excel Remove Duplicates
- Method 2: Select, highlight, and remove duplicate rows with Kutools
- Method 3: Remove duplicate rows with VBA
- Which method should you use
- Frequently asked questions
- The Best Office Productivity Tools
Kutools for Excel
Brings 300+ advanced features to Excel
- 🧩 Overview
- 📥 Free Download
- 🎁 30-Day Free Trial available







