Eliminating duplicate records using advanced filter even with unique set to true

B

burl_rfc

The code below is supposed to select all the none duplicate records
from a given range, but for some strange reason I do get duplicates but
only when the first cell in the range is identical to the second cell
in the range, if the first and second cells within the range are not
identical then I get all none duplicates in the output.

How can I prevent the output from containing duplicate records?

I did think of pre-sorting the range so that non-duplicate records were
in the first and second cells, but I can never guarentee that
non-duplicates would be in the range.

Dim aRange As Object

Set aRange = ActiveSheet.Range _
(Selection, Selection.End(xlDown))
aRange.AdvancedFilter Action:=xlFilterCopy, CopyToRange:= _
Range("G3"), Unique:=True

burl
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top