In Microsoft Excel, you can use the AutoFilter feature to filter a list
based on simple criteria. For example, if you have a list of salespeople
that has a column of names and a column containing each person's total
sales for the month, you can use the AutoFilter to show the records for the
top ten salespeople, based on their sales amounts for the month. The
ability to display the top 10 items in a list is a feature of the
AutoFilter in Excel. Excel adds the Top Ten feature to the drop-down list boxes that appear in all columns when you turn on the AutoFilter, but you can only use this feature on columns that contain numeric values.
You can customize the Top Ten feature in AutoFilter to filter a different
number of top items in your list, such as the top 3 or top 100. You can modify this feature to display between 1 and 500 records. To manually
change the number of items that appear in your AutoFilter top ten list to a
number less than or greater than 10 (for example, if you want to show the
top five items), click the arrow in the column you want to filter, click
Top 10 in the drop-down list box, and then change the number of items in the Top Ten AutoFilter dialog box to the number of items you want to be displayed.
This article provides several samples of Microsoft Visual Basic for Applications macro code that you can use to control the AutoFilter feature in Excel.
Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.