Resetting A Group Of AutoFilters

Hello,

I use a large spreadsheet with nearly every column set to AutoFilter. Quite often, multiple columns are then sorted by filtering to view desired results.

A macro is needed to reset the entire group of column filters to ‘All’, returning the sheet to it’s pre-filtered state. Can anyone offer a solution?

Thank You!

Janenn (LO 3.6, WIN 7

If I have understood right your question, it is easy to solve:

Select the filter in any of the columns.
Select the standard filter.
Select the first field name.
Go to the top for select none.
Click Ok.
That’s all.

You can use a macro to toggle filters on and off. The first step in the macro should be to position the cursor to one of the field names in the filter (e.g. cell $A$1 – change for your case). You can then hook the macro to a button or a menu for ease of use. To reset, not toggle, merely execute the filter toggle line twice.

sub Toggle_filter
dim document   as object
dim dispatcher as object
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name="ToPoint"
args1(0).Value="$A$1"  rem **** Change for your case ****
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args1())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:DataFilterAutoFilter", "", 0, Array())
rem Uncommenting the following line turns the toggle into a reset
rem dispatcher.executeDispatch(document, ".uno:DataFilterAutoFilter", "", 0, Array())
end sub

Thanks to you both for taking the time to respond…

Elegant solutions!

Janenn