Hans Petter Naumann
Hans Petter Naumann

Reputation: 801

multiple autofilters for the same EPPlus worksheet

Im creating an xlsx-file using EPPlus and want to have autofilters for all headers. I set the autofilters like this:

worksheet.Cells["A3:G" + (3 + data.Count).ToString()].AutoFilter = true;

This works smooth for just one table of content. However, I have two separate tables in the same worksheet, and when trying to set autofilters for the second one, the autofilters for the first one disappears.

Any known workarounds for this, or other suggestions?

Upvotes: 9

Views: 2903

Answers (1)

Gary's Student
Gary's Student

Reputation: 96771

This is a very good question!

A traditional limitation of AutoFilter is that it can be applied only once on a worksheet.

Starting with Excel 2007 you can create several Tables on a worksheet...........each with filtering capabilities.

See Pieterse's Article

Upvotes: 6

Related Questions