> For the complete documentation index, see [llms.txt](https://xlswriter-docs.viest.me/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://xlswriter-docs.viest.me/english/cell/auto-filter.md).

# Auto filter

## **Function Prototype**

```php
autoFilter(string $range): self
```

### **string $range**

> Filter/Filter Data Range

## Example

```php
$config = ['path' => './tests'];
$excel = new \Vtiful\Kernel\Excel($config);

$filePath = $excel->fileName("tutorial.xlsx")
     ->header(['name', 'age'])
     ->data([
         ['one', 10],
         ['two', 20],
         ['three', 30],
     ])
     ->autoFilter("A1:B3") // Add Filter/Filter
     ->output();
```
