# Putting filters in Excel with VBA

**URL:** <https://forum.robusta.ai/t/putting-filters-in-excel-with-vba/113>\
**Category:** FAQ\
**Created:** [May 9, 2022, 8:38am UTC](https://forum.robusta.ai/t/putting-filters-in-excel-with-vba/113 "2022-05-09T08:38:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ilayda.ipar](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robusta.ai/ilayda.ipar/32/56_2.png) [@ilayda.ipar](https://forum.robusta.ai/u/ilayda.ipar)\
**Post date:** [May 9, 2022, 8:38am UTC](https://forum.robusta.ai/t/putting-filters-in-excel-with-vba/113/1 "2022-05-09T08:38:05Z")

</div>

Filters can be placed on specific columns in Excel with the following VBS. Passive and shopping locations are options that we do not want to appear as printouts.

```auto
Set objXLApp = CreateObject("Excel.Application")
objXLApp.Visible = False
objXLApp.DisplayAlerts = False
Set objXLWb = objXLApp.Workbooks.Open("C:\Robusta\Output\Robusta_072021_End.xlsx")
objXLWb.Worksheets(2).Range("L2").AutoFilter 7,"<>..."
objXLWb.Worksheets(2).Range("L2").AutoFilter 31,"<>..."
objXLWb.Save
objXLWb.Close
objXLApp.Quit

```
