PDA

View Full Version : Solved: Find unique values



justdriving
09-17-2011, 05:20 PM
Hi,

I have Col A where usernames are given like this: -

111111
111111
111111
111111
111111
222222
222222
222222
333333
333333
333333
333333
444444
444444
555555
555555
555555
555555

(1) These username(s) can extend up to n-th row for n-times, as shown above. I want to find unique usernames and list them all in Cell O2. How can I do it using VBA?



ThisWorkbook.Activate
Columns("A:A").Select
Range("A1:A89").AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Columns("O:O"), Unique:=True




Aforesaid program can not calculate End row in Col A.

mikerickson
09-17-2011, 05:34 PM
With Range("A:A")
With Range(.Cells(1,1),.Cells(.Rows.Count, 1).End(xlup))
.AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Range("O1"), Unique:=True
End With
End With

justdriving
09-18-2011, 02:00 PM
Thank you.