Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Trapping the AutoFilter Event
I have a worksheet that has the AutoFilter enabled.
Is there a method to trap when the user selects to perform the AutoFilter? I want to carry out a few steps when they do. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Trapping the AutoFilter Event
Hi John
Try this from should get you what you want. Need to change the sheet name and insert your actions. Take care Marcus Sub autofil() With Worksheets("Sheet1") If .AutoFilterMode Then 'Your code here End If End With End Sub |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Trapping the AutoFilter Event
I don't see how that would work...if the user performs a AutoFilter action,
what would trigger the Sub AutoFil procedure? "marcus" wrote: Hi John Try this from should get you what you want. Need to change the sheet name and insert your actions. Take care Marcus Sub autofil() With Worksheets("Sheet1") If .AutoFilterMode Then 'Your code here End If End With End Sub . |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Trapping the AutoFilter Event
Sorry misread your post.
This from the msdn website "One of the limiting aspects of using the AutoFilter feature in a business solution is that it has no directly associated event in the Excel object model. In other words, when a filter is applied or changed, by a user or programmatically, there is no explicit event for the activity." The article goes on to explain a way to capture the autofilter event with the use of smart tags. Will let you get your head around it. It is worth reading. http://msdn.microsoft.com/en-us/libr...ffice.10).aspx Take care Marcus |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Trapping the AutoFilter Event
You can use the Calculate Event to trap AutoFilter changes. For example:
=SUBTOTAL(2,A:A) will give the count of visible cells in column A. Excel re-calculates this whenever the AutoFilter is adjusted and the event gets triggered. -- Gary''s Student - gsnu200909 "PosseJohn" wrote: I have a worksheet that has the AutoFilter enabled. Is there a method to trap when the user selects to perform the AutoFilter? I want to carry out a few steps when they do. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Trapping SheetChange Event in COM add-in | Excel Programming | |||
trapping charts event | Charts and Charting in Excel | |||
Trapping Add Shape Event | Excel Programming | |||
Error trapping for the Form_Activate() event | Excel Programming | |||
Trapping Excel Close event | Excel Programming |