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 :)
 

Some videos you may like

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.

stickboy

Board Regular
Joined
Jun 23, 2002
Messages
84
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?
 

ChrisUK

Well-known Member
Joined
Sep 3, 2002
Messages
675
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
 

nehpets12

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

Watch MrExcel Video

Forum statistics

Threads
1,122,518
Messages
5,596,630
Members
414,082
Latest member
sasmita

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
Top