Find duplicate rows of multiple cells...

spacely

Board Regular
Joined
Oct 26, 2007
Messages
248
Hi ...

I have a rectangular arrangement of cells, and want to detect if any row has the same entries as any other row, in the range of rows of interest. A trigger at the end of the duplicate rows, or a conditional format to display which are copies of each other would be great.

So:

1 3 6 4 3 2 1 3
4 5 6 7 3 2 1 4
6 7 8 1 0 8 7 6
4 5 6 7 3 2 1 4

..would flag as row 2 and 4 being identical.

Thanks!
 
Apologies, I wasn't thinking. It should be
Code:
Sub ColourDuplicates()
   Dim Valu As String
   Dim Cl As Range
   Dim UsdCols As Long
   
   UsdCols = Cells(1, Columns.Count).End(xlToLeft).Column
   With CreateObject("scripting.dictionary")
      For Each Cl In Range("A1", Range("A" & Rows.Count).End(xlUp))
         Valu = Join(Application.Transpose(Application.Transpose(Cl.Resize(, UsdCols))))
         If Not .exists(Valu) Then
         .Add Valu, Cl.Resize(, UsdCols)
         Else
         Cl.Resize(, UsdCols).Font.Color = vbRed
         .Item(Valu).Font.Color = vbRed
         End If
      Next Cl
   End With

End Sub
=====
Fluff, That was fantastic! It worked great! I then searched for rows with red text and all that needed to be revealed was exposed.
Thanks!
ed9213
 
Upvote 0

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Glad to help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,919
Messages
6,175,368
Members
452,638
Latest member
Oluwabukunmi

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