Finding Duplicates

akendrick

New Member
Joined
May 22, 2017
Messages
1
How can I highlight duplicate cells in a column if when checked against another column

I have numbers in A1:A100, and numbers in C1:C2500, how can I highlight the numbers in column "C" if they appear in column "A"?
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Try this macro:

(Probably not the most efficient way, but only took a second for me to run)

Code:
Sub changeduplicatetored()

Dim rownum As Long
Dim rownum2 As Long


rownum = 1
rownum2 = 1
Do Until rownum = 101
rownum2 = 1
Do Until rownum2 = 2501
If Cells(rownum, 1).Value = Cells(rownum2, 3).Value And Cells(rownum, 1).Value <> "" Then
Cells(rownum2, 3).Interior.ColorIndex = 3
Cells(rownum2, 3).Font.ThemeColor = xlThemeColorDark1
End If
rownum2 = rownum2 + 1
Loop
rownum = rownum + 1
Loop


  
End Sub
 
Upvote 0
Another option would be to use conditional formatting.

Select cells C1to C2500
Go to:
-Conditional Formatting
-New Rule
-Use Formula
In formula box put
=ISNUMBER(MATCH(C1,$A$1:$A$100,0))
-Format
-Choose format color
-OK
-OK
 
Upvote 0

Forum statistics

Threads
1,223,901
Messages
6,175,277
Members
452,629
Latest member
SahilPolekar

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