Find duplicates across sheets

drangle

New Member
Joined
Jan 11, 2017
Messages
13
I have searched Excel Questions and have not found an answer to my question.

I have a spreadsheet with five sheets, I need to see if there are duplicates in column A on three of those sheets. (I am comparing sheet 1 with sheet 2 and sheet 1 with sheet 3.) By the way, column A is social security numbers. This seems simple but I can't seem to highlight column A in two sheets to do conditional formatting.

Thanks for helping.

Dennis
 

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.
To clarify, you want to highlight any value in column A of sheets 2 and 3 if the value exists in column A of Sheet1. Is this correct?
 
Upvote 0
Try:
Code:
Sub FindDups()
    Application.ScreenUpdating = False
    Dim Rng As Range, RngList As Object, ws As Worksheet
    Set RngList = CreateObject("Scripting.Dictionary")
    With Sheets("Sheet1")
        For Each Rng In .Range("A2", .Range("A" & .Rows.Count).End(xlUp))
            If Not RngList.Exists(Rng.Value) Then
              RngList.Add Rng.Value, Nothing
            End If
        Next
    End With
    For Each ws In Sheets(Array("Sheet2", "Sheet3"))
        For Each Rng In ws.Range("A2", ws.Range("A" & ws.Rows.Count).End(xlUp))
            If RngList.Exists(Rng.Value) Then
              Rng.Interior.ColorIndex = 3
            End If
        Next
    Next ws
    Application.ScreenUpdating = True
End Sub
 
Upvote 0
Select A2:a last row on sheet 2 & use this formula
=ISNUMBER(MATCH(A2,Sheet1!$A$2:$A$49,0))
then select your format

Do the same for sheet3
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,243
Members
449,075
Latest member
staticfluids

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