Duplicate Entries In Rows

nehpets12

Active Member
Joined
Feb 22, 2002
Messages
453
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

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
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?
 
Upvote 0
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
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,214,982
Messages
6,122,580
Members
449,089
Latest member
Motoracer88

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