autofilter's events

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

Hi,
I look up in VBA easy syntax for solution of below problem.
I'd like to get some info (e.g. info about amount of
selected records) after make a choice in autofilter.
It should be work only if filter is selected.

I would be very grateful for any help and all suggestions.
Regards
Mark
 
Hi Mark

Sub test()
If ActiveSheet.AutoFilterMode Then
MsgBox Application.WorksheetFunction.Subtotal(2, Range("A2:A1000"))
Else
MsgBox "No filter"
End If
End Sub

or simply a worksheet formula in a cell:
=SUBTOTAL(2,A2:A1000)
 
If you insert my SUBTOTAL formula into a cell then autofiltering will trig
the worksheets CALCULATE event, otherwise it won't. Think that's your only
option, but I may of course be wrong.
 
I don't find any events associate with change filter,
either..
So, remain me use subtotal.
Best regards for helper.
Mark
 
Back
Top