XL.Sheet.AutoFilter.SetTop10
----------------------------

Sets the number of top or bottom items.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [XL](component_XL.md) | [7.3](newinversion73.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "XL.Sheet.AutoFilter.SetTop10"; BookRef; SheetIndex; FilterColumnIndex; Value; Top; Percent ) 

**MBS**( **"XL.Sheet.AutoFilter.SetTop10";** /\* Sets the number of top or bottom items. \*/  
**$BookRef**; /\* The reference number for the workbook.e.g. $ref \*/   
**$SheetIndex**; /\* The index of the sheet. This number ranges from 0 to [XL.Book.SheetCount](XLBookSheetCount.md)-1.e.g. 0 \*/   
**$FilterColumnIndex**; /\* The column index of the filter.  
Range from 0 to [XL.Sheet.AutoFilter](XLSheetAutoFilter.md).ColumnSize-1.e.g. $FilterColumn \*/   
**$Value**; /\* Number of items \*/   
**$Top**; /\* Pass 1 to get top items or 0 for bottom items.e.g. 1 \*/   
**$Percent**) /\* Pass 1 for percent values.e.g. 1 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| BookRef | The reference number for the workbook. | $ref |
| SheetIndex | The index of the sheet. This number ranges from 0 to [XL.Book.SheetCount](XLBookSheetCount.md)-1. | 0 |
| FilterColumnIndex | The column index of the filter.   Range from 0 to [XL.Sheet.AutoFilter](XLSheetAutoFilter.md).ColumnSize-1. | $FilterColumn |
| Value | Number of items |  |
| Top | Pass 1 to get top items or 0 for bottom items. | 1 |
| Percent | Pass 1 for percent values. | 1 |

### Result

Returns OK or error.

### Description

Sets the number of top or bottom items.  
### See also

- [XL.Book.SheetCount](XLBookSheetCount.md)
- [XL.Sheet.AutoFilter](XLSheetAutoFilter.md)
- [XL.Sheet.AutoFilter.AddSort](XLSheetAutoFilterAddSort.md)
- [XL.Sheet.AutoFilter.ColumnSize](XLSheetAutoFilterColumnSize.md)
- [XL.Sheet.AutoFilter.GetRef](XLSheetAutoFilterGetRef.md)
- [XL.Sheet.AutoFilter.GetSort](XLSheetAutoFilterGetSort.md)
- [XL.Sheet.AutoFilter.GetSortEx](XLSheetAutoFilterGetSortEx.md)
- [XL.Sheet.AutoFilter.GetTop10](XLSheetAutoFilterGetTop10.md)
- [XL.Sheet.AutoFilter.SetRef](XLSheetAutoFilterSetRef.md)
- [XL.Sheet.AutoFilter.SetSort](XLSheetAutoFilterSetSort.md)

This function checks for a license.

Created 1st July 2017 , last changed 1st July 2017

  
[XL.Sheet.AutoFilter.SetSort](XLSheetAutoFilterSetSort.md) - [XL.Sheet.AutoFilter.SortLevels](XLSheetAutoFilterSortLevels.md)

[HTML Version](XLSheetAutoFilterSetTop10.shtml)