Trapping Autofilter event


Posted by Manish Deliwala on August 17, 2001 9:51 AM

I am amatuer, and am using Autofilter to focus on cells
of interest. Is there a way to trap autofilter event
in VBA - i.e. when user changes the criteria.



Posted by Damon Ostrander on August 17, 2001 10:35 PM

Hi Manish,

There is no specific event defined for a filter object, but you can trap a filter change because a filter change triggers the worksheet's calculate event (Worksheet_Calculate). In this event routine you can then test to see if the filter criteria has changed using the filter's Criteria1 and Criteria2 properties, and the On property that indicates whether the filter is active or not.

Happy computing.

Damon