+ Reply to Thread
Results 1 to 4 of 4

Detect when autofilter drop-down selection made

  1. #1
    Forum Contributor
    Join Date
    08-21-2008
    Location
    Hamilton, New Zealand
    MS-Off Ver
    Office 2007
    Posts
    255

    Detect when autofilter drop-down selection made

    Is it possible to detect when a auto-filter selection has been made ?
    Is that when an autofilter hides rows, the activecell could become hidden, which potentially may cause errant data entry, not knowing what cell is receiving entry as it is hidden from view.

    if the worksheet contains a change event that autosizes the target row, it unhides the filtered hidden row in the process.

    I could say if target is hidden ignore autosize, but i would prefer to activate a visible cell (first visible cell for filtered column) on selection of autofilter.

    Any suggestions ?
    Last edited by wotadude; 10-07-2009 at 04:05 PM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Detect when autofilter drop-down selection made

    Hello wotadude,

    If there are any internal Excel events associated with the auto-filter, they aren't exposed to VBA. You would need to create a workaround, but that depends on what you are trying to do. You would need to explain in detail what you want to do before it can be declared possible or not.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Detect when autofilter drop-down selection made

    I certainly agree with Leith that more info would be good but I can't resist these as I always find them interesting...

    One possible workaround would be to ensure you

    a) have say 1 volatile calculation on your sheet containing the Auto Filter, eg

    =NOW()

    the above will ensure the Calculate event is triggered (given alteration of Row Visibility is Volatile Action) ...

    b) apply a Calculate Event to the sheet object based on active row visibility

    Please Login or Register  to view this content.
    in the above I set this up to select the first visible cell below the headers - however if you simply want to select the header cell remove the Offset(1) from the above.

    To insert the above right click on tab containing the filter - select View Code and past above into resulting window ensuring macros enabled thereafter.

    I'm sure it's not watertight but I hope it gives you some ideas...
    Last edited by DonkeyOte; 10-07-2009 at 05:19 AM. Reason: typo

  4. #4
    Forum Contributor
    Join Date
    08-21-2008
    Location
    Hamilton, New Zealand
    MS-Off Ver
    Office 2007
    Posts
    255

    Re: Detect when autofilter drop-down selection made

    Thank you both.
    Donkeyote - that it the spot nicely.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1