Duplicate Entries In Rows

nehpets12

Active Member
I have tried searching the board but no luck.

I have 27 columns of Data
I am trying to find all the rows that have the same data but not necessarily in the same order. The data can have duplicate entries or blanks

1,2,2,4,5, ,6
2,4, ,6,1,2,5

Any help would be most useful
Thanks

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a \$25,000 loan, 5% annual interest, 60 month loan.
HOW MANY DIFFERENT ENTRIES CAN YOU HAVE. IF IT IS ONLY ONE TO SIX, IN THEORY YOU COULD USE COUNTIF TO COUNT EACH TYPE OF ENTRY, AND THEN MATCH THE ROWS THAT WAY USING THE RESULTS OF THE COUNTS.

DO YOU KNOW ANYTHING ABOUT SHARING WORKBOOKS OVER NETWORKS?

Try this. It uses sheet one first 5 columns only and sheet 2 as workspace so beware!!

Sub DupEntries()

'Copy the first sheet to the second sheet and use as workspace
Cells.Select
Selection.Copy
Sheets("Sheet2").Select
ActiveSheet.Paste

nColCount = 0

'Enter the columns to check
rng = Array("A:A", "B:B", "C:C", "D:D", "E:E")

'Sort each column individualy
For Each c In rng
nColCount = nColCount + 1
Columns(c).Select
Selection.Sort Key1:=Range(Mid(c, 1, 1) & "1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Next

sColMatch = "Matching Columns are "

For x = 1 To nColCount
For y = x To nColCount - 1
nNoMatch = 0
For w = 1 To 100 'Only check the first 100 cells in each column
If Cells(w, x).Value <> Cells(w, y + 1).Value Then
nNoMatch = 1
Exit For
End If
Next
If nNoMatch = 0 Then
sColMatch = sColMatch & ": " & Str(x) & " and " & Str(y + 1)
End If
Next
Next

'Delete the workspace sheet and move back to first sheet
Sheets("Sheet2").Select
Cells.Select
Cells.Delete
Sheets("Sheet1").Select
Range("A1").Select

'Show the matching columns
MsgBox sColMatch

End Sub

Thanks Chris

I must have confused you, the data I am trying to match is in rows. I have about a 1000 rows, and I am trying to find what rows have had the same data entered in them. I would like the answer just to say true or false in a spare column.

Thanks

Replies
5
Views
136
Replies
2
Views
75
Replies
6
Views
539
Replies
1
Views
45
Replies
3
Views
210

1,218,920
Messages
6,145,225
Members
450,602
Latest member
AceSpace

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.

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

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