How to Check DUPLICATE Rows

NEW_2VBA

Board Regular
Joined
Dec 15, 2015
Messages
106
Is there a macro or other Excel resource I can use to check for duplicate values entered in a row?

Each row contains about 15 cells so I need to know if there are any instances of all 15 cells being identical.

Some information will be duplicated however we're trying to identify the line entries that are exactly alike in all 15 cells within a spreadsheet containing sometimes over 5K+ rows of data. Thanks! Here's a condensed example:[TABLE="class: outer_border, width: 500, align: left"]
<tbody>[TR]
[TD]Invoice[/TD]
[TD]Date[/TD]
[TD]Job[/TD]
[TD]Name[/TD]
[TD]Description[/TD]
[TD]Amount[/TD]
[/TR]
[TR]
[TD]1456A[/TD]
[TD]4/11/18[/TD]
[TD]Analyst[/TD]
[TD]John Doe[/TD]
[TD]Professional Services[/TD]
[TD]$800[/TD]
[/TR]
[TR]
[TD]1456A[/TD]
[TD]4/11/18[/TD]
[TD]Analyst[/TD]
[TD]John Doe[/TD]
[TD]Professional Services[/TD]
[TD]$800[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
What do you want to do with the duplicate entries?
 
Upvote 0
Ok, how about
Code:
Sub FindDuplicateRows()

   Dim Cl As Range
   Dim ValU As String
   
   With CreateObject("scripting.dictionary")
      For Each Cl In Range("A2", Range("A" & Rows.count).End(xlUp))
         ValU = Join(Application.Transpose(Application.Transpose(Cl.Resize(, 15).Value)), "|")
         If Not .exists(ValU) Then
            .Add ValU, Cl
         Else
            Cl.Resize(, 15).Interior.Color = 45678
            .Item(ValU).Resize(, 15).Interior.Color = 45678
         End If
      Next Cl
   End With
End Sub
 
Upvote 0
It worked like a charm!! THANK YOU!! Is it possible to highlight orange?
 
Last edited:
Upvote 0
Glad to help & thanks for the feedback
 
Upvote 0
Is there a macro or other Excel resource I can use to check for duplicate values entered in a row?

Each row contains about 15 cells so I need to know if there are any instances of all 15 cells being identical.

Some information will be duplicated however we're trying to identify the line entries that are exactly alike in all 15 cells within a spreadsheet containing sometimes over 5K+ rows of data. Thanks! Here's a condensed example:

Hi!

Try the formula below too in Coditional Formatting:

=SUM(--(MMULT(--($A2:$F2=$A$2:$F$10),TRANSPOSE(COLUMN($A1:$F1)/COLUMN($A1:$F1)))=COLUMNS($A1:$F1)))>1

Markmzz
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top