Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Eliminating duplicate records using advanced filter even with unique set to true

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 698
Default Eliminating duplicate records using advanced filter even with unique set to true

Hi Burl,

Try putting a header in the top cell.

HTH
Regards,
Howard

"burl_rfc" wrote in message
oups.com...
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
unique records by advanced filter Stefi Excel Discussion (Misc queries) 10 October 5th 09 08:04 AM
Advanced Filter - extracting unique records Balan Excel Worksheet Functions 2 September 4th 07 03:12 AM
"Live" Advanced Filter (for unique records) RussG Excel Discussion (Misc queries) 15 August 3rd 07 01:10 PM
Error using Advanced Filter Unique Records headly Excel Discussion (Misc queries) 5 May 9th 06 01:36 AM
Inconsistent Results: Advanced Filter Unique Records Only KB Excel Discussion (Misc queries) 1 March 25th 05 02:34 PM


All times are GMT +1. The time now is 01:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"