is there a way of saving a filter?

  • Thread starter Thread starter BruceJ
  • Start date Start date
B

BruceJ

If I have my speadsheet filtered (several differernt filters applied, or
some other complex filter) and I need to jump out of filtered mode, is the a
way I can "save" the filter to something like a varible or something,
unfilter, do what I need to, and then reset the filter to what it was? these
are not filters I would ness want to save to a macro, as they might be
unique for a given task, but I would like to reset the filter to what I had
before so that I could finish processing what I was doing....

TIA
Bruce
 
Bruce,

Look at the filters collection, autofilter object. Something like

MsgBox ActiveSheet.AutoFilter.Filters(2).Criteria1

This will return the criteria of a filter applied to the second field of the
autofilter.
 
You can create a Custom View with the filtered rows:

1. Filter the table
2. Choose View>Custom Views
3. Click Add
4. Type a name for the Custom View
5. Check the box for 'Hidden rows, columns and filter settings'
6. Click OK

To apply the view later, choose View>Custom Views, select the view, click OK
 
Question on this feature...

Example Data:
A B C
1 CA A
2 CA B
3 FL C
4 WA D
5 TX E

If I have a filter and I save ti to State_CA it would show me rows 1 and 2.
Now if I then Change row 4 to CA, would it show me 1,2 and 4, or still only
1 and 2?

Thanks
Bruce
 
You can test it in your workbook, but all qualifying rows should be
displayed when you show a saved view. In your example, row 4 would be
included, as it now meets the criteria.
 
Back
Top