Find Duplicate Entries

  • Thread starter Thread starter Frank Wilson
  • Start date Start date
F

Frank Wilson

I have a list in column A and a list in column B. I would
like to have a macro that compares the two lists and then
records duplicate entries in column C and unique entries
in column D. Would anyone have a macro / macros that
would do this?

P.S. I know that this can be done with array formulas.
However, the data set is so large that the arrays did not
properly calculate. I would prefer code if possible.
 
Hi,

This will find the duplicate entries . . .

Sub Find_Duplicates()

Dim CompareRange As Variant
Dim Selection As Variant
Dim x As Variant
Dim y As Variant

Set Selection = Range("B2:B6")
Set CompareRange = Range("C2:C6")

For Each x In Selection
For Each y In CompareRange
If x = y Then x.Offset(0, 2) = x
Next y
Next x

End Sub

John Mansfield
pdbook.com
 
Back
Top