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
- Login or register to post comments
- 11213 reads
Recent comments
5 years 45 weeks ago
6 years 30 weeks ago
6 years 42 weeks ago
6 years 45 weeks ago
6 years 46 weeks ago
7 years 6 hours ago
7 years 8 weeks ago
7 years 8 weeks ago
7 years 8 weeks ago
7 years 8 weeks ago