Comparing and finding duplicates on Spreadsheet on two different tabs

Joined
Jul 31, 2019
Messages
18
You all rocked my world last time I was faced with a difficult Excel problem, so I'm trying it again!

Is there a way to compare/find duplicates on a spreadsheet on different tabs?

I have a list of September names on one tab, and have an October list of names on a second tab. Eventually, I'll have a November on a third, December on a fourth, etc.

I want a way to indicate/flag names if they've been on previous month's list. Example: If the name was on the September list, I want to flag it on the October list (or highlight).

Make sense? Is that possible? If so, how?

THANKS!
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
A few questions
1) Are the sheets called September, October etc?
2) What cells are the names in?
3) If a name is on the October & November list but not on the September list, would you want it flagged on the Nov list?
 
Upvote 0
1. Yes, those are the titles of the sheet tabs
2. I would love to be able to flag the names in column B and C ... on all sheets, if possible.
3. Yes, flag it from the previous month regardless of which month.
 
Upvote 0
Are the names in B & C separate, or do they need to be matched as a pair (ie first name & surname)?
If a name is in September, but not October & reappears in November should it still be flagged?
 
Upvote 0
The names in B and C go together - therefore to be flagged together as a unit. (Don't flag if it just says "James" in col B ... instead, flag if it reads "James" in col B and "Smith" in col C)

Yes, it should still be flagged, but I highly doubt that will be the case with the project I'm working on.

THANKS!!!
 
Upvote 0
Ok, how about
Rich (BB code):
Sub AngelaN2()
   Dim Cl As Range
   Dim Dic As Object
   Dim Mnth As String, Vlu As String
   Dim i As Long
   
   Set Dic = CreateObject("scripting.dictionary")
   For i = 9 To 12
      Mnth = MonthName(i)
      If Evaluate("isref('" & Mnth & "'!A1)") Then
         With Sheets(MonthName(i))
            For Each Cl In .Range("B2", .Range("B" & Rows.Count).End(xlUp))
               Vlu = Cl.Value & "|" & Cl.Offset(, 1).Value
               If Not Dic.Exists(Vlu) Then
                  Dic.Add Vlu, Mnth
               Else
                  Cl.Interior.Color = 45678
                  Cl.Offset(, 2).Value = Mnth
               End If
            Next Cl
         End With
      End If
   Next i
End Sub
The line in red will add the first month the name was found into col D. Delete it if not needed.
 
Upvote 0
My pleasure & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,882
Messages
6,175,164
Members
452,615
Latest member
bogeys2birdies

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