View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
[email protected] austris.bahanovskis@gmail.com is offline
external usenet poster
 
Posts: 6
Default How can run a macro ( call a macro) on selection of any filtercriteria?

Just googled this:
"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."

Haven't checked myself but makes perfect sense. So, you might want to
have a public variable storing a collection (all the filter fields
with their according parameters) and when Worksheet_Calculate raises -
check if the collection has changed. There might be simpler way of
doing this, though.