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
 

Some videos you may like

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

mumps

Well-known Member
Joined
Apr 11, 2012
Messages
8,744
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?
 

mumps

Well-known Member
Joined
Apr 11, 2012
Messages
8,744
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
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
35,603
Office Version
365
Platform
Windows
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
 

Forum statistics

Threads
1,089,450
Messages
5,408,306
Members
403,196
Latest member
annph

This Week's Hot Topics

  • help please
    SORRY NOT ANY GOOD AT EXCEL SO HELP WOULD BE MUCH APPRECIATED this formula is in a sheet called ignore...
  • two formulas needed
    Hello, I'll try my best to explain this: First formula needed in Sheet1 cell A2: If Sheet1 cell B2 = Sheet2 cell B2 then return a 1. If not then...
  • Dynamic Counts
    Good afternoon, we are tidying up some data & the data seems to be growing quicker than we are tidying it up! What we confirm (by reviewing it...
  • Help Excel formula eliminate duplicate values and keep only 2 identical rows.
    as picture below column A has a duplicate value. but the values are not the same as the rule. sometimes 4 rows, sometimes 10 rows or 7 or 9...
  • Macro Compile Error Sub or Function not defined
    Hello, I am trying to run macros from a validation list, all macros have been created and run perfectly on there own but I'm getting a compile...
  • Last row combined with Current Region VBA
    I'm generally happy finding the last row of data through something like Lastrow = Cells(Rows.Count, "D").End(xlUp) but I don't always receive data...
Top