Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AdvancedFilter Method in Excel 2000 vba 1

Status
Not open for further replies.

corsair2

IS-IT--Management
Feb 21, 2001
55
GB
I'm trying to filter (unique records) and copy a range using vba which I have previously named (again using vba).
I'm using the "AdvancedFilter" method and the filter works fine except that the first entry in the original range is always duplicated in the filtered list.
Any ideas?
 
Are you sure that first entry is the first entry and not field names (column headings) that are being returned? Perhaps your code needs to be changed slightly? I don't do VBA, but I've heard of this behavior and it turned out to be something stupid like they had freeze panes on or somehow the column headings were being returned like they were data. Sorry I can't remember.
techsupportgirl@home.com
Brainbench MVP for Microsoft Word at
 
I think the advanced filter is looking for, and assumes you will have, a header row for your data.

If the header is excluded from the source range you will still get a "duplicate", but it should be the first desired record.

Let me know if this works for you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top