Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
autofilter's events
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
autofilter's events
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) -- HTH. Best wishes Harald Excel MVP Followup to newsgroup only please "Mark" skrev i melding ... 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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
autofilter's events
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. -- HTH. Best wishes Harald Excel MVP Followup to newsgroup only please "Mark" skrev i melding ... Harald, I meant about uniwersal code and event, which to do automatically after choice. Without any button. Thx |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
autofilter's events
I don't find any events associate with change filter,
either.. So, remain me use subtotal. Best regards for helper. Mark -----Original Message----- To the best of my knowledge: There aren't any events triggered by filter activities beyond the general calculate event if there are cell dependencies. there is no change event, or Click event associated with selecting criteria in the dropdown. Anything you do with respect to this will have to be based on your own "cleverness". -- Regards, Tom Ogilvy "Mark" wrote in message ... I'd like only find development code (below) about events when I choise in filter. As you see with calculation I managed. Sub examp() Dim rng As Range Set rng = ActiveSheet.AutoFilter.Range MsgBox rng.Columns(1). _ SpecialCells(xlVisible).Count - 1 _ & " of " & Range("A1").CurrentRegion.Rows.Count - 1 & " Records" End Sub -----Original Message----- 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. -- HTH. Best wishes Harald Excel MVP Followup to newsgroup only please "Mark" skrev i melding ... Harald, I meant about uniwersal code and event, which to do automatically after choice. Without any button. Thx . . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
change XL2003 autofilter's arrow color | Excel Discussion (Misc queries) | |||
# Events over time? | Excel Discussion (Misc queries) | |||
events? | Excel Discussion (Misc queries) | |||
How do I find blank cells using AutoFilter's Custom feature? | Excel Worksheet Functions | |||
VBProject events? | Excel Programming |