+ Reply to Thread
Results 1 to 9 of 9

Toggle button to apply filter criteria

  1. #1
    Registered User
    Join Date
    06-11-2016
    Location
    Norway
    MS-Off Ver
    2013
    Posts
    4

    Toggle button to apply filter criteria

    Hello,
    I have the following sheet:
    AjlJtrt.png


    I'm looking to have the button to filter so that only "long term isolations" are shows.
    Only rows with a value/date in column K.

    And when click again, the filter is reset.

    I have no experience or knowledge in using ActiveX or macros.
    So I hope that maybe someone here can help med out?

    Cheers,
    John

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Toggle button to apply filter criteria

    Hi Storic,

    Welcome to the Forum!

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window (or use the paperclip icon).
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    06-11-2016
    Location
    Norway
    MS-Off Ver
    2013
    Posts
    4

    Re: Toggle button to apply filter criteria

    Thanx for your reply.

    Have made an example workbook with 2 sheets. Where sheet number 2 shows how I want the filter to work when I press the button.

    When I press the button once more, I would like to reset the filters so that everything is shown.

    Have searched online, but have not been able to get anything to work.

    I don't know if this script is something that is usable? With some modification off course.
    And it has to work in a table, since there will be more rows added as we go.

    Please Login or Register  to view this content.
    Hope someone understands what I'm aiming for and are able to help me.

    Cheers,
    Attached Files Attached Files

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Toggle button to apply filter criteria

    Try this:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    06-11-2016
    Location
    Norway
    MS-Off Ver
    2013
    Posts
    4

    Re: Toggle button to apply filter criteria

    Thanx again,

    I'm not exactly sure how/where to put this to get it to work?

    Capture.JPG

  6. #6
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: Toggle button to apply filter criteria

    Press ALT F11. DoubleClick on Sheet3(Button pressed example)
    Paste code in right hand window.
    Please Login or Register  to view this content.
    Last edited by bakerman2; 06-12-2016 at 03:30 AM.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  7. #7
    Registered User
    Join Date
    06-11-2016
    Location
    Norway
    MS-Off Ver
    2013
    Posts
    4

    Re: Toggle button to apply filter criteria

    Quote Originally Posted by bakerman2 View Post
    Press ALT F11. DoubleClick on Sheet3(Button pressed example)
    Paste code in right hand window.
    Please Login or Register  to view this content.
    Thanx a lot!

    That does exactly what I wanted! =)

  8. #8
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: Toggle button to apply filter criteria

    Thanks for the rep.
    Credit of course goes to Orrin for original code which I just had to put in the right context.

  9. #9
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Toggle button to apply filter criteria

    Sorry that I didn't explain it more - here's how I would do it:

    Please Login or Register  to view this content.
    Thanks to Bakerman2 for finishing for me

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Use Toggle Button to filter
    By biznez1 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-04-2018, 06:16 AM
  2. Toggle button to turn on/off a filter
    By jcmckeon in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-26-2016, 03:15 PM
  3. [SOLVED] VBA Apply Filter Using Cell Value as Criteria
    By hobbiton73 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-22-2014, 06:32 AM
  4. Replies: 1
    Last Post: 02-13-2014, 10:55 PM
  5. Get filter criteria from one sheet and apply to other one
    By akira1985 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-02-2013, 01:41 PM
  6. advanced filter - button to re apply advanced filter across multiple sheets
    By motmac87 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-05-2013, 11:16 PM
  7. [SOLVED] VBA Code to apply criteria to a filter
    By kenadams378 in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 08-13-2012, 04:34 AM

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