Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 95
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 95
Default 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
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
change XL2003 autofilter's arrow color BK Excel Discussion (Misc queries) 9 February 5th 10 11:42 AM
# Events over time? Jon M Excel Discussion (Misc queries) 2 May 23rd 09 04:37 PM
events? [email protected] Excel Discussion (Misc queries) 1 September 14th 05 03:26 PM
How do I find blank cells using AutoFilter's Custom feature? Andrea Blake Excel Worksheet Functions 2 November 30th 04 09:03 PM
VBProject events? Chip Pearson Excel Programming 0 September 10th 03 10:36 AM


All times are GMT +1. The time now is 09:41 PM.

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

About Us

"It's about Microsoft Excel"