DUPLICATES

ebraun

Board Regular
Joined
Sep 1, 2002
Messages
141
I HAVE A SHEET OF 550 LINES WHAT IS THE BEST WAY TO CHECK IF THERE'S NO DUPLICATE
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

ChrisUK

Well-known Member
Joined
Sep 3, 2002
Messages
675
You need to sort the range (makes it run faster as you need shorter loops)

Then use VB code to search.

Sub Duplicates()

For x = 1 To 8
For y = x + 1 To 8
If Cells(x, 1).Value = Cells(y, 1).Value Then
rtnVal = MsgBox("Duplicate at row " & Str(y), vbCritical + vbOKOnly, "Error!!")
End If
Next y
Next x

End Sub

HTH
 
Upvote 0

WJReid

Active Member
Joined
Jul 26, 2002
Messages
317
Hi ebraun,

If you select the range A1:A500 and then go to Format|Conditional Formatting and in the formula box type:

=($A$1:$A$500,a1)>1

then select your format e.g. red pattern. Any duplicates will now be highlighted with a red background.

Regards,

Bill
 
Upvote 0

WJReid

Active Member
Joined
Jul 26, 2002
Messages
317
Hi ebraun,

If you select the range A1:A500 and then go to Format|Conditional Formatting and in the formula box type:

=($A$1:$A$500,a1)>1

then select your format e.g. red pattern. Any duplicates will now be highlighted with a red background.

Regards,

Bill
 
Upvote 0

WJReid

Active Member
Joined
Jul 26, 2002
Messages
317
ADVERTISEMENT
Hi ebraun,

If you select the range A1:A500 and then go to Format|Conditional Formatting and in the formula box type:

=($A$1:$A$500,a1)>1

then select your format e.g. red pattern. Any duplicates will now be highlighted with a red background.

Regards,

Bill
 
Upvote 0

ebraun

Board Regular
Joined
Sep 1, 2002
Messages
141
BUT I AM GETTING AN ERROR MASSAGE SAYING

YOU MAY NOT USE UNIONS, OR ARRAY CONSTANTS FOR CONDITIONAL FORMATTING CRITERIA

CAN ANY ONE HELP
 
Upvote 0

ebraun

Board Regular
Joined
Sep 1, 2002
Messages
141
ADVERTISEMENT
BUT I AM GETTING AN ERROR MASSAGE SAYING

YOU MAY NOT USE UNIONS, OR ARRAY CONSTANTS FOR CONDITIONAL FORMATTING CRITERIA

CAN ANY ONE HELP
 
Upvote 0

ebraun

Board Regular
Joined
Sep 1, 2002
Messages
141
BUT IT SAYS TRUE OR FALSE I WANT TO SEE TOTAL # OF DUPLICATES AND WHAT THE DUP ARE NO VBA PLEASE
 
Upvote 0

Juan Pablo González

MrExcel MVP
Joined
Feb 8, 2002
Messages
11,959
No need to yell around here.

=COUNTA(F1:F23)-SUM(1/COUNTIF(F1:F23,F1:F23))

will return the number of duplicate items in F1:F23. That is an array formula. To return a list of unique items (Wich makes more sense than a list of duplicates) use Advanced Filter.
 
Upvote 0

Forum statistics

Threads
1,195,682
Messages
6,011,132
Members
441,586
Latest member
rodsin76

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