I have the VBA code below that I have used successfully to highlight the duplicates across 2 worksheets and for a single column range. I am wanting to highlight the duplicates across 3+ worksheets for the same column range within each worksheet. The formula I have used for highlighting across 2 sheets is below. Any assistance would be greatly appreciated.
Hi TMS.
Since you helped me so much the first time with this VBA, would you know how I can modify it to highlight the duplicates between 3 worksheets within the same workbook? The formula works to highlight for 2 worksheets, but I am not sure what to add to run it for more than 2 worksheets; there is only a single column in each that I am comparing.
Thanks in advance for any guidance.
The formula I have used for 2 worksheets is as follows:
Sub findDuplicates()
Dim rng1, rng2, cell1, cell2 As Range
Set rng1 = Worksheets("Week 1").Range("B1:B200")
Set rng2 = Worksheets("Week 2").Range("B1:B200")
For Each cell1 In rng1
For Each cell2 In rng2
If IsEmpty(cell2.Value) Then Exit For
If cell1.Value = cell2.Value Then
cell1.Font.Bold = True
cell1.Font.ColorIndex = 2
cell1.Interior.ColorIndex = 3
cell1.Interior.Pattern = xlSolid
cell2.Font.Bold = True
cell2.Font.ColorIndex = 2
cell2.Interior.ColorIndex = 3
cell2.Interior.Pattern = xlSolid
End If
Next cell2
Next cell1
End Sub
Bookmarks