+ Reply to Thread
Results 1 to 23 of 23

Filter one column with multiple checkboxes

  1. #1
    Registered User
    Join Date
    10-22-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    12

    Filter one column with multiple checkboxes

    Hi excel guru's!!

    I am in need of some VBA coding that will allow me to filter a specific column with multiple check boxes. For example, I have a worksheet with over 100 rows of data and each row in column B has a month. Can I have check boxes for each month and filter my data based on the check boxes that I select?

    I have been able to write some code that allows me to filter for just one month, but I cannot seem to figure our how to get multiple months.

    Thanks for all your help!!

  2. #2
    Registered User
    Join Date
    08-15-2012
    Location
    Las Vegas
    MS-Off Ver
    Excel 2010
    Posts
    87

    Re: Filter one column with multiple checkboxes

    Please attach a sample workbook and give specific examples of what you want to accomplish. I am sure what you want to accomplish is possible but your question seems a bit vague.

  3. #3
    Registered User
    Join Date
    10-22-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Filter one column with multiple checkboxes

    See attached for an example...

    In the workbook is a list of 25 properties and I want to be able to filter the data based on column B. I want to create check boxes for R1, R2, R3 and R4 and have the data filter based on which boxes I select.

    For example, I select R1, R2 and R3 boxes and only the rows with those values (in column B) would appear. When I unselect the box then those rows would not appear.

    Hopefully, this shines some light on my question. Let me know if you need anything else. Thanks!
    Attached Files Attached Files

  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: Filter one column with multiple checkboxes

    Hi pjohnson05

    Here's a slightly different approach...using Cells as Check Boxes. Double Click on any Cell in Range C3:C6 to check or uncheck the cell then click the Filter Me Button.
    Let me know of issues.
    Attached Files Attached Files
    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.

  5. #5
    Registered User
    Join Date
    10-22-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Filter one column with multiple checkboxes

    Thanks for the quick response jaslake!

    Works like a charm! Is there a reason why we can't use check boxes? Would that require to much Code? Also, just curious as to why it doesn't refresh after each selection (Filter Me button)?
    Last edited by pjohnson05; 10-23-2012 at 05:03 PM.

  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: Filter one column with multiple checkboxes

    Hi pjohnson05

    If you're working on Book1 v1.xlsm and have checked any cells in Sheets Data in Range C3:C6 (Double LEFT Click to check or uncheck) and then clicked the FilterMe Button and nothing happens then I have no thoughts. I've tested the code and it works as designed on my platform in Excel 2010.

  7. #7
    Registered User
    Join Date
    10-22-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Filter one column with multiple checkboxes

    Sorry jaslake...I had the old workbook open still and that was causing the issue.

    Couple questions if you have time....Is there a reason why we can't use check boxes? Would that require to much Code? Also, just curious as to why it doesn't refresh after each selection (Filter Me button)?

  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: Filter one column with multiple checkboxes

    Hi pjohnson05

    As I mentioned,
    this is slightly different approach...using Cells as Check Boxes
    Sure, we can use Check Boxes. You develop them in your worksheet, where you want them, how they'll be labeled and I'll help you write the code.

    Regarding this
    just curious as to why it doesn't refresh after each selection
    On my platform, if you CHANGE the selections and press the Filter Me Button it does refresh to reflect the new selections.

  9. #9
    Registered User
    Join Date
    10-22-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Filter one column with multiple checkboxes

    Great! Thanks so much buddy. It would really be ideal if I had checkboxes.

    See attached for a new schedule with ActiveX checkboxes.
    Attached Files Attached Files

  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: Filter one column with multiple checkboxes

    Hi pjohnson05

    See code in attached for ActiveX Check Boxes.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    10-22-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Filter one column with multiple checkboxes

    Wow...your amazing!

    So, to be a little clearer on one of my questions earlier...is there a way to eliminate the "Filter Me" button? That way once I select or unselect a check box it will run the filter.

  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: Filter one column with multiple checkboxes

    I'll look at this...not tonight
    is there a way to eliminate the "Filter Me" button?

  13. #13
    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: Filter one column with multiple checkboxes

    Hi pjohnson05

    Try the code in the attached...let me know of issues.
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    10-22-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Filter one column with multiple checkboxes

    Wow! money!!

    Seems to work just fine. Thanks for all your help Jaslake!! I've spent over a week trying to get that to work. Many thanks!

  15. #15
    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: Filter one column with multiple checkboxes

    Hi pjohnson05

    You're welcome...glad I could help.
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

  16. #16
    Registered User
    Join Date
    10-22-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Filter one column with multiple checkboxes

    Hey jaslake,

    I need your help again! I feel so bad hitting you up so much but I really can't figure out the next part of my workbook. I tried to post a new thread last Thursday (see below for link) but no body has responded. If you get some free time would you mind taking a look? Thanks so much! your the man!

    http://www.excelforum.com/excel-prog...97#post2983197

  17. #17
    Registered User
    Join Date
    07-12-2013
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Filter one column with multiple checkboxes

    Thank you guys for this stuff, I'll surely use it in one of my projects.It's really close to what I'm looking for. Even though, my preference was to have these controls in a userform rather than a worksheet. Thank you jaslake for the support.

  18. #18
    Registered User
    Join Date
    09-16-2014
    Location
    USA
    MS-Off Ver
    14
    Posts
    1

    Re: Filter one column with multiple checkboxes

    This is fantastic work. Exactly what I was looking for. Thank you.

  19. #19
    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: Filter one column with multiple checkboxes

    Hi rw.eipi

    Welcome to the Forum!!!

    You're welcome...glad I could help.

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

  20. #20
    Registered User
    Join Date
    10-23-2018
    Location
    Wisconsin, USA
    MS-Off Ver
    2016
    Posts
    6

    Re: Filter one column with multiple checkboxes

    So I realize that this thread is over 4 years old since the last time someone commented on it, but I came across this while searching for an answer to a similar situation and this is the closest I have gotten to an answer. Hopefully someone that has seen this thread before is still active on this forum and can either point me in the right direction of a simpler solution or help explain how I could modify this for the need I have.

    My situation is this:

    I have a column on worksheet2 that I need to filter based on certain values. Those values will need to filter as a group of values, not just individually. For example: The column may contain apples, pears, cucumbers, eggplants, squash, carrots, cheese, milk, cream. What I want the autofilter to do, however, is filter these by a defined group or category denoted by a checkbox. So on worksheet1, checkbox1 would be fruit, checkbox2 would be vegetables and checkbox3 would be dairy. If the user checks one box, it filters to show only those values associated with that group. If they select two checkboxes, it would select the values for both groups.

    Any suggestions or assistance would be greatly appreciated.

  21. #21
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,620

    Re: Filter one column with multiple checkboxes

    J_Marley,
    Unfortunately your post does not comply with Rule 4 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
    Ben Van Johnson

  22. #22
    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: Filter one column with multiple checkboxes

    Hi J_Marley
    Welcome to the Forum!!!
    As Ben Van Johnson pointed out, you'll need to start your own Thread. When you've done so you may PM me if you wish and I'll look at it with you.

    In your new Thread please attach a sample workbook the Structure of which is the same as your actual 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.

    INCLUDE ANY CODE YOU'RE USING OR HAVE TRIED.

    Remember to desensitize the data.

    To do this, click on Go Advanced (below the Edit Window) while you are composing a reply, then scroll down to and click on Manage Attachments and the Upload window will open. Click on Browse and navigate to (and double-click) the file icon that you want to attach, then click on Upload and Close this Window to return to the Edit window. When you have finished composing your post, click on Submit Post.

  23. #23
    Forum Contributor
    Join Date
    11-17-2018
    Location
    Los Angeles
    MS-Off Ver
    Office 2010
    Posts
    209

    Re: Filter one column with multiple checkboxes

    Hello,

    Quick question:

    How can this solution be modified so that instead of using the check boxes on an specific area it is used instead on each row?

    In the example provided on post #13, the check boxes are at the top of the sheet. You click in the box to put the checkbox and the corresponding value will be filtered in the table below.

    However, I would like to insert the checkbox (or an "X" or something) next to the row that I need filtered and only that row (or all the rows where I have the checkbox, or "X") to be shown. In other words, to do it per row (and obviously using a column where I would enter the checkbox or the "X").

    I hope my scenario makes sense.

    If this scenario is already done (a solution provided), can you please give me the link?

    Thank you.

+ 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