Filtering and copy

palladan

New Member
Joined
Dec 13, 2016
Messages
1
Hello there,

i would like to ask you for a help.

Im looking for make my results from the races sorted automaticly using VBA in excel.

Criteria: Category and Sex

I have got 7 sheets, on the 1 one I have got data in 11 collums the last two collums include Category(39, 49, 50) and sex(Male, Female)

Each sheet content the racers from one category and sex (Male 39, Male 49, Male 50, Female 39, Female 49, Female 50)

I think that I have to use AdvancedFilter, but its not working. It will copy all the data to list Male 39

Sub Sorter()




ListName = ActiveSheet.Name


Sheets(ListName).Range("Tabulka[#All]").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Sheets(ListName).Range("J1", "K1"), CopyToRange:=Sheets("Male 39").Range("A2:J2"), Unique:=True

Columns.AutoFit




End Sub

Thank you for your help
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

Forum statistics

Threads
1,214,515
Messages
6,119,972
Members
448,933
Latest member
Bluedbw

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