Selecting filters

Mangolili

Board Regular
Joined
Jun 21, 2011
Messages
54
Is there a VBA version that does this? I want to select a filter from a column,
ran the macro, then delete the previous filter that's selected. Select a new filter from another
column, ran the macro again.

Is there any way to do it? Please let me know. Thanks



""" Handles the user clicking the **Delete** button. """ # Get the list of available filters: filters = info.filter.factory.values if info.initialized: # Delete the current filter: index = filters.index( self.filter ) del filters[ index ] # Select a new filter: if index >= len( filters ): index -= 1 self.filter = filters[ index ] self._refresh_filters( info )</pre>
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
for example the data range is defined by "r"
r.autfilter.........................
will filter the data.

after doing whatever to be done wit the filtered data you write again
r.autifilter
the filter is removed.

another way for removing the filter if the sheet is activated
activesheet.autofiltermode=false
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,836
Members
452,947
Latest member
Gerry_F

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top