Why does Advanced Filter require named parameters?

Glory

Well-known Member
Joined
Mar 16, 2011
Messages
640
Code:
[COLOR=darkgreen]Range("A1:A1000").AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Range("E2"), Unique:=True[/COLOR]


Code:
[COLOR=red]Range("A1:A1000").AdvancedFilter(xlFilterCopy, Range("E2"), True)[/COLOR]


Red fails, green succeeds. But I don't understand why it's necessary to specifically name the parameters, when it's normally possible to simply type in arguments.
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
If you don't use named arguments then the arguments need to be in the right position in the list.
So you have to do something to take into account any missing arguments.
Usually that just means adding an extra comma.
 
Upvote 0
I guess that includes arguments that are exclusive? Like with advanced filter, you wouldn't do copytorange if you were having it sort in place. But you still need to have a comma to delimit the position of the argument in the list?
 
Upvote 0

Forum statistics

Threads
1,224,566
Messages
6,179,550
Members
452,927
Latest member
rows and columns

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