Hi everyone,

We have written the below macro code. It works fine in Excel 2013 but not for 2010. The code is for getting unique values.
It does not show error for the macro, but it still does NOT process.
Can u please guide us?


Sub GetUniquecampaigns()
Dim d As Object, c As Variant, i As Long, lr As Long
Set d = CreateObject("Scripting.Dictionary")
lr = Cells(Rows.Count, 1).End(xlUp).Row
c = Range("A2:A" & lr)
For i = 1 To UBound(c, 1)
d(c(i, 1)) = 1
Next i
Sheets("sheet1").Range("A3").Resize(d.Count) = Application.Transpose(d.keys)

End Sub