Remove Duplicates (Get Uniques) Excel 2007

You can use the following simple procedure to remove duplicates either in place or get uniques at another range. The second parameter of the below procedure is optional. Try this in Excel 2007.
Sub RemoveDups(rngDups As Range, Optional rngTarget As Range) If rngTarget Is Nothing Then rngDups.RemoveDuplicates Columns:=1, Header:=xlNo Else rngDups.AdvancedFilter Action:=xlFilterCopy, CopyToRange:=rngTarget, Unique:=True End If End Sub Sub Test() Call RemoveDups(ActiveSheet.Range("A1:A10"), ActiveSheet.Range("D1")) End Sub
»
- Vishesh's blog
- Add new comment
- 972 reads

Recent comments
9 hours 35 min ago
20 hours 57 min ago
1 day 10 hours ago
1 day 10 hours ago
1 day 13 hours ago
1 day 23 hours ago
2 days 2 hours ago
2 days 3 hours ago
2 days 9 hours ago
2 days 10 hours ago