Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Any way to capture an Autofilter event?

I want to execute some code whenever a filtering event has occurred
(selecting a value from the filter drop-down list). There are many events
that can occur on a worksheet (calculate, change, etc.) but none of them kick
off for a filter selection.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Any way to capture an Autofilter event?

You can use the calculate event, but you need a formula that is dependent on the results of the
filter. Name a cell FormCell, and put a formula like:

=SUBTOTAL(9,B1:B100)

into it. Then name another cell ValueCell, and use code like this: you can replace the msgbox with
your code.

Private Sub Worksheet_Calculate()
If Range("FormCell").Value < Range("ValueCell").Value Then
MsgBox "Filtered"
Application.EnableEvents = False
Range("ValueCell").Value = Range("FormCell").Value
Application.EnableEvents = True
End If
End Sub

HTH,
Bernie
MS Excel MVP


"mrwaller" wrote in message
...
I want to execute some code whenever a filtering event has occurred
(selecting a value from the filter drop-down list). There are many events
that can occur on a worksheet (calculate, change, etc.) but none of them kick
off for a filter selection.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Capture the hyperlink event before it goes to the link Korekiyo Baisotei Excel Discussion (Misc queries) 0 September 25th 08 05:53 AM
Capture Update Links event VBA will Daborn Excel Programming 2 July 19th 05 11:51 AM
How to Capture Edit Cell Event? Vinit[_2_] Excel Programming 3 June 29th 05 12:53 PM
Capture scrolling event Allen[_12_] Excel Programming 2 April 22nd 04 03:37 AM
capture paste event into a cell No Name Excel Programming 3 January 30th 04 07:24 PM


All times are GMT +1. The time now is 04:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"