Filter mechanism - Is this a bug?

Gary McMaster

Well-known Member
Joined
Feb 8, 2009
Messages
1,978
Hi All,

I'm using the VBA statement below to return a list of unique values from column A to column B (column B = Column A with no duplicates ... except 1).

It always seems to return the first value in column A twice (one duplicate). Am I doing something wrong or is this a bug?

According to help, setting the "unique" flag to true shouldn't be giving me this duplicate.

Range("A:A").AdvancedFilter xlFilterCopy, , Range("B:B"), True

Thanks very much for your input.

Gary
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Hi Gary,

Does the table you are filtering have column headers?
 
Upvote 0
It is the problem - it assumes that the first row is column headers so wouldn't consider the first row that matched them to be a duplicate.

Glad to help... :)
 
Upvote 0

Forum statistics

Threads
1,213,528
Messages
6,114,154
Members
448,553
Latest member
slaytonpa

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top