The following article provides an overview of how to filter ListObjects by using the Excel Auto Filter. This example and code below uses the following spreadsheet as the basis

The following C# code will filter "Carrots" and "Potato" using an Array
- private void ExcelFilterExample()
- {
- String[] FilterList = {"Carrots","Potato"};
- Excel.Workbook oWB = Globals.ThisAddIn.Application.Workbooks.Open(@"C:\Users\Documents\NameOfWorkbook.xls");
- Excel.Worksheet oWS = oWB.Worksheets[1];
- oWS.ListObjects.AddEx (Excel.XlListObjectSourceType.xlSrcRange, oWS.UsedRange, System.Type.Missing ,Excel.XlYesNoGuess.xlYes).Name = "VeggieList";
- oWS.ListObjects["VeggieList"].Range.AutoFilter(2, FilterList, Excel.XlAutoFilterOperator.xlFilterValues );
- }
Please note every attempt has been made to get the code 100% accurate. Please pardon any typos or errors.

Sneha ChokannaPosted Aug 10, 2018, 12:35 AM
It is working thanks a lot
Michael GriffithsPosted May 8, 2016, 3:49 AM
Nice
Rajaganapathi DhalapathiPosted Dec 6, 2010, 7:26 AM
Hi Dave, I have been trying to generate excel file dynamically, everything works fine except i am not able to prouce Auto filter in excel could you provide some help.