+ Reply to Thread
Results 1 to 16 of 16

Multiple Checkboxes to filter

  1. #1
    Registered User
    Join Date
    12-01-2014
    Location
    Pennsburg, PA
    MS-Off Ver
    2010
    Posts
    10

    Multiple Checkboxes to filter

    I want to thank anyone who helps me first.

    I am very new to macros so i might be getting too far ahead of myself with this. I have a multipage userform, and on page2, if page 1 is 0, I have a frame with 18 difference checkboxes. I want to be able to select more than one at a time and have them filter column C on Sheet1 for any cell that contains the caption of any checkbox selected. Is this at all possible. I think i have read every forum on the matter and can't find exactly what i need.

    Right now the checkboxes filter the first one selected and subfilters every one checked after that point.

    Downstream 14.0.xlsm

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Multiple Checkboxes to filter

    Hi Ashley.Martin100208

    Welcome to the Forum!!!

    It'll be something like this
    Please Login or Register  to view this content.
    First, get rid of all your Checkbox Click Events. Then create another Command Button in the User Form and assign the Code to that New Button (in this Case, Command Button 2).

    I couldn't test it because your Code does not Compile and there's no Data in Sheet1.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  3. #3
    Registered User
    Join Date
    12-01-2014
    Location
    Pennsburg, PA
    MS-Off Ver
    2010
    Posts
    10

    Re: Multiple Checkboxes to filter

    Thanks John,
    I really do appreciate your help.
    I am still having two issues with this.
    I am just assuming what causes it, is that I have more than one option listed in a single cell. It seems to only pull the items if they are listed individually. Is there anyway to change this to a "all cells that contain this prefix" type of situation?
    The other issue is it seems to only generate one result at a time. I have some heavy formulas in the database on the spreadsheet and I don't know if this is whats causing some problems.

    I plugged in a few pieces of dummy information.
    Capture.PNG

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Multiple Checkboxes to filter

    Hi Ashley

    I can't view Pictures...the Forum feature is broken at the moment for me and others. In any event, pictures are of little value. Place the Data in a File and upload the new File.

  5. #5
    Registered User
    Join Date
    12-01-2014
    Location
    Pennsburg, PA
    MS-Off Ver
    2010
    Posts
    10

    Re: Multiple Checkboxes to filter

    Sorry,
    Here is the doc with some fields filled in.

    Downstream 14.1.xlsm

  6. #6
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Multiple Checkboxes to filter

    Hi Ashley

    See if this works for you
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    12-01-2014
    Location
    Pennsburg, PA
    MS-Off Ver
    2010
    Posts
    10

    Re: Multiple Checkboxes to filter

    You are amazing!
    Thank you so much!

  8. #8
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Multiple Checkboxes to filter

    Hi Ashley

    You're welcome...glad I could help. Thanks for the Rep.

    I discovered something in playing around with the Code. If you happen to select a Check Box whose Check Box Caption does not exist in Column C "Policy Prefix" the Code will return nothing.

    Is this an issue or will ALL Check Box Captions ALWAYS exist in Column C "Policy Prefix". The issue can "probably" be addressed if not.

  9. #9
    Registered User
    Join Date
    12-01-2014
    Location
    Pennsburg, PA
    MS-Off Ver
    2010
    Posts
    10

    Re: Multiple Checkboxes to filter

    I don't honestly know at this point. This is a base for a huge project. There are times where it will be probable.

  10. #10
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Multiple Checkboxes to filter

    Hi Ashley
    We'll see if we can deal with this...probably not tonight...
    Quote Originally Posted by Ashley.Martin100208 View Post
    I don't honestly know at this point. This is a base for a huge project. There are times where it will be probable.

  11. #11
    Registered User
    Join Date
    12-01-2014
    Location
    Pennsburg, PA
    MS-Off Ver
    2010
    Posts
    10

    Re: Multiple Checkboxes to filter

    No worries. Thanks for all your help so far. I might not respond quick after tonight. Driving to Florida tomorrow.

  12. #12
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Multiple Checkboxes to filter

    Safe travel...

  13. #13
    Registered User
    Join Date
    12-01-2014
    Location
    Pennsburg, PA
    MS-Off Ver
    2010
    Posts
    10

    Re: Multiple Checkboxes to filter

    I am sorry I didn't write sooner. In addition to your statement about how if a checkbox is selected that is not listed it returns nothing, I am also having an issue where if I dont make a selection at all it gives me an error. I am thinking I could just add a no filter checkbox or something that could fix my other problem but after reviewing your note, yes I would need that to be functioning if a checkbox is selected.

  14. #14
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Multiple Checkboxes to filter

    Hi Ashley

    Hope you had a GREAT and SAFE vacation/visit.

    This fix was straight forward
    if I dont make a selection at all it gives me an error
    This fix, on the other hand, required a totally different approach
    if a checkbox is selected that is not listed it returns nothing
    The Code in the attached handles both issues. My concern is how much overhead it will require on a massive File.

    Try it...we'll see.
    Attached Files Attached Files

  15. #15
    Registered User
    Join Date
    12-01-2014
    Location
    Pennsburg, PA
    MS-Off Ver
    2010
    Posts
    10

    Re: Multiple Checkboxes to filter

    The code seems to work great. However, now my clear search button does not seem to clear it 100%. It seems to clear all the results which is great but the cells that were hidden are now remaining hidden.

    Private Sub CommandButton2_Click()
    Worksheets("Sheet4").Range("J1") = ""
    Worksheets("Sheet1").Range("D2") = ""
    If (ActiveSheet.AutoFilterMode And ActiveSheet.FilterMode) Or ActiveSheet.FilterMode Then
    ActiveSheet.ShowAllData
    End If

    End Sub


    I am also worried about the size of the file since it is not yet completed. There will be thousands of combinations of results. I would love to try and remove the formulas in sheet1 to condense it down some more. However, my skill level is limited. I don't know if there is an option to have the userform return the results without using the formulas.

  16. #16
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Multiple Checkboxes to filter

    Hi Ashley

    For this, this Code
    clear search button does not seem to clear it 100
    Please Login or Register  to view this content.
    Regarding this, the User Form Code is looking at values. The Code cares not where the values came from.
    I would love to try and remove the formulas in sheet1 to condense it down some more. However, my skill level is limited. I don't know if there is an option to have the userform return the results without using the formulas.

+ 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] Filter one column with multiple checkboxes
    By pjohnson05 in forum Excel Programming / VBA / Macros
    Replies: 22
    Last Post: 12-15-2021, 03:19 PM
  2. [SOLVED] Filter Excel cells using UserForm CheckBoxes
    By Darkenergyz in forum Excel Programming / VBA / Macros
    Replies: 33
    Last Post: 09-09-2021, 04:08 PM
  3. [SOLVED] Filter multi data Using combobox and checkboxes
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-23-2014, 01:35 AM
  4. Using checkboxes to filter a list
    By Pete1989 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-15-2014, 06:57 PM
  5. [SOLVED] Use Checkboxes to Filter a List
    By corrinrenee in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-02-2013, 08:23 PM

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