Autofilter data with Multiple Text Critera

Hi, appreciate your help, this is regarding autofilter data in Excel Data Filtering|Documentation in the filtering Text, how do I filter data with Multiple Criteria, in the example shown in the link it filtered the first column with only 1 criteria: “Angola”, how do I add more item criteria to filter on the same column?

@myDAN,

You may try to use AutoFilter.AddFilter method instead for the purpose. See the following lines of code for your reference.

worksheet.AutoFilter.AddFilter(0, "Angola");
worksheet.AutoFilter.AddFilter(0, "Algeria");
...

Hope, this helps a bit.

1 Like

Thank you for this, it’s straightforward just adding another line for it, how about if I want to select all items in the column then Unselect “Angola” and “Algeria”?

@myDAN

Then you may use:

worksheet.AutoFilter.Custom(0, FilterOperatorType.NotEqual, "Angola",true, FilterOperatorType.NotEqual, "Algeria");
1 Like

Thank you much appreciated

@myDAN,

You are welcome. If you have any other queries or comments, please feel free to contact us at any time. We will be happy to assist you soon.

1 Like