Filtering by three criteria including top ten value

T

Thomp

This is hopefully a littler better explanation of an earlier post of
mine. I need to filter a list of information by first the Year and
Product. I then need to know of those now filtered results what are
the top ten results by revenue a third column. Have tryed Large
functions and it didn't work. Any help would be greatly appreciated.

thanks,
Also I have attached my spreadsheet as an example
 
J

joel

There was no attachment. the code below uses autofilter to filter th
3 columns. then the code uses specialcells to select the visible row
to get the results. I basically recorded a macro and then editied th
macro to simplify the code.



Sub Gettop10()

ColACriteria = "a"
ColBCriteria = "B"
LastRow = Range("A" & Rows.Count).End(xlUp).Row

Columns("A:C").AutoFilter
Columns("A:C").AutoFilter Field:=1, Criteria1:="a"
Columns("A:C").AutoFilter Field:=2, Criteria1:="b"
Columns("A:C").AutoFilter Field:=3, _
Criteria1:="10", Operator:=xlTop10Items

Set top10 = Rows("1:" & LastRow).SpecialCells(Type:=xlCellTypeVisible)

top10.Select

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top