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
- 11199 reads
Recent comments
5 years 43 weeks ago
6 years 29 weeks ago
6 years 41 weeks ago
6 years 44 weeks ago
6 years 45 weeks ago
6 years 50 weeks ago
7 years 6 weeks ago
7 years 7 weeks ago
7 years 7 weeks ago
7 years 7 weeks ago