Hi,
I have a script where I input a list of values in column A of sheet1, then after I run the macro I want to have a unique list of the duplicate values on sheet2 in column A, however, the only thing listed is the header can someone tell me where I am going wrong?
Sub DuplicateFinder()
Dim data(), unique As Variant, r As Long, lr As Long
lr = Sheet1.UsedRange.Rows(Sheet1.UsedRange.Rows.Count).Row
data = Sheet1.Range("A2:A" & lr).Value
Set unique = CreateObject("Scripting.Dictionary")
For r = 1 To UBound(data)
unique(data(r, 1)) = Empty
Next r
Sheet2.Range("A1") = unique.Keys
End Sub
Bookmarks