+ Reply to Thread
Results 1 to 29 of 29

Filter Cells using Checkboxes

  1. #1
    Registered User
    Join Date
    01-08-2021
    Location
    USA
    MS-Off Ver
    2007
    Posts
    15

    Filter Cells using Checkboxes

    I want a spreadsheet with a list of film titles where I can assign multiple tags to each film. Then I want a filter option where I can check certain tags from the ones I created that will display only the entries that correspond to the checked tags (removing everything else).

    For example, suppose I create the following possible tags: 70s, 80s, USA, foreign, Italian, French, giallo, slasher, vampire

    I add the entry "Suspiria" and assign tags: 70s, foreign, Italian, giallo
    I add the entry "The Slumber Party Massacre" and assign the tags: 80s, USA, slasher
    I add the entry "The **** Vampire" and assign tags: 70s, foreign, French, vampire

    So if I check either of the tags "Italian" or "giallo", the only film that would remain would be "Suspiria" with all the others being filtered out.
    If I check "70s", "Suspiria" and "The **** Vampire" would remain.
    If I check "slasher", only "The Slumber Party Massacre" would remain.

    You get the idea. I've attached a dummy document to show you how far I've gotten (which is not far) as well as screenshots of how the complete list would look (with nothing checked) as well as the above three examples showing how I want the functions to work. Of course, I made these screenshots by manually deleting the corresponding film titles from the list. These screen just show how I want the spreadsheet to function. I just don't know how to actually get it to do it. Thanks for the help.
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by MovieBuff; 01-08-2021 at 12:49 PM.

  2. #2
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,345

    Re: Filter Cells using Checkboxes

    Hi,
    Give the attached a viewing, rather than developing a nightmare.
    Put your films in column 'A' (A2 downwards ) and your genres as the table headers (B1, C1, etc.,)
    The table expands automatically with additions - ensure there are no blank rows or extra unused columns or rows beyond the table.
    put 'x' in appropriate intersecting cells (i think that is obvious) - not a single checkboxe to add.
    torachan.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    01-08-2021
    Location
    USA
    MS-Off Ver
    2007
    Posts
    15

    Re: Filter Cells using Checkboxes

    Thanks, but this doesn't seem to do what I want. The idea is to be able to filter out films that don't meet the qualifications (i.e., the boxes I check).

  4. #4
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,345

    Re: Filter Cells using Checkboxes

    Have you tried it, thats precisely what it does.

  5. #5
    Registered User
    Join Date
    01-08-2021
    Location
    USA
    MS-Off Ver
    2007
    Posts
    15

    Re: Filter Cells using Checkboxes

    Sorry, I'm using an older version of Excel (2007). I never use any of the Office programs so that's why it's not current. The file you attached still opens, but it removes some of the content (probably what controls the filter feature), so on my end, I don't see any way of filtering it. What version of Excel do I need to open this correctly? Or is there a way to make the file work with my version? Thanks.
    Attached Images Attached Images

  6. #6
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,345

    Re: Filter Cells using Checkboxes

    It was produced using Excel 2010.
    In the VBA editor goto Tools > References - are there any shown as missing.
    Most likely problem - (Microsoft Excel 12.0 Object Library) this is used by 2007 however (Microsoft Excel 14.0 Object Library) is used by 2010.
    Whatever the difference within I do not know.
    torachan.

  7. #7
    Registered User
    Join Date
    01-08-2021
    Location
    USA
    MS-Off Ver
    2007
    Posts
    15

    Re: Filter Cells using Checkboxes

    The VBA editor button is greyed out and unclickable. Is it possible to save the spreadsheet you gave me in a format that 2007 can recognize?

  8. #8
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,345

    Re: Filter Cells using Checkboxes

    Give the attached file a try.
    It may require you to allow macros to run.
    The VBA has been passed through Norton and has no viruses.
    torachan.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    01-08-2021
    Location
    USA
    MS-Off Ver
    2007
    Posts
    15

    Re: Filter Cells using Checkboxes

    I get the same error message I got with the previous file. Please see attached screenshot. And I do have "Enable all macros" selected in the Trust Center. Sorry for being such a bother, I really do appreciate your continued help.
    Attached Images Attached Images
    Last edited by MovieBuff; 01-09-2021 at 11:58 AM.

  10. #10
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,345

    Re: Filter Cells using Checkboxes

    HELP !!! Please.
    Any one with Excel 2007 and 2010 could you please assist.
    If you could open either or both of the files please and comment.
    I am at a loss why the O.P. is experiencing difficulty as I can not find anything wrong with the files when I download them back to my second computer.
    torachan.

  11. #11
    Registered User
    Join Date
    01-08-2021
    Location
    USA
    MS-Off Ver
    2007
    Posts
    15

    Re: Filter Cells using Checkboxes

    I tried both files on another PC and they both worked. Now I just have to figure out why they don't open properly on my PC. I'm going to try uninstalling and reinstalling excel. I'll keep you posted.
    Last edited by MovieBuff; 01-09-2021 at 01:33 PM.

  12. #12
    Registered User
    Join Date
    01-08-2021
    Location
    USA
    MS-Off Ver
    2007
    Posts
    15

    Re: Filter Cells using Checkboxes

    EDIT: Well, some good news, some bad news.

    I uninstalled and reinstalled Excel 2007. Both files opened without the error message but the "Show Form" button didn't do anything when I clicked it. Macro and ActiveX settings were enabled in Trust Center. So I uninstalled 2007 again and installed 2010. The file now opens and the "Show Form" button functions properly. Hooray!

    Now for the bad news: It appears you are only able to filter the results by selecting a single table header at a time. I wanted to be able to select any number of them to further filter the results. For example, if I have five films tagged with "vampire", but only three of those same five are also tagged with "Italian", when I use the form, if I select both "vampire" and "Italian" headings, only those three films that satisfy both of the selected conditions will be displayed. Is there a way to modify your function so that it can filter by multiple headings in the manner I just described? We're almost there! Thank you for being patient and for the continued help.
    Last edited by MovieBuff; 01-09-2021 at 05:04 PM.

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

    Re: Filter Cells using Checkboxes

    Try this one:
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Ben Van Johnson

  14. #14
    Registered User
    Join Date
    01-08-2021
    Location
    USA
    MS-Off Ver
    2007
    Posts
    15

    Re: Filter Cells using Checkboxes

    That is super close protonLeah! I love the format and the layout. This is pretty much exactly what I originally had in mind. The only thing is that the "Show Selected Only" button shows any title that has a check...like it is using an OR function rather than an AND function. I want it to only show films that satisfy ALL the checks I have selected, rather than ANY of the checks I have selected. For instance, if I check "70s", "Italian", and "Vampire", when I click "Show Selected Only", I only want it to display films that satisfy all three: "70s", "Italian," and "Vampire". As it is, it seems that it displays all films that satisfy ANY of those three rather than ALL of the three. I hope that makes sense.
    Last edited by MovieBuff; 01-10-2021 at 01:05 AM.

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

    Re: Filter Cells using Checkboxes

    Sorry for the delay.
    Shows only titles where there is a * and the corresponding genre flag is checked.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by protonLeah; 01-13-2021 at 04:21 PM.

  16. #16
    Registered User
    Join Date
    01-08-2021
    Location
    USA
    MS-Off Ver
    2007
    Posts
    15

    Re: Filter Cells using Checkboxes

    This works! The only thing is, some of the cells turn red when I double click to make selections. For instance, if I double click the "foreign" tag for Masked Zombies, that cell turns red when it has an * in it. Or if I double click "Italian" for Andromedia Strain, the cell next to it under "foreign" turns red (even though that cell is empty). It seems only the cells under the "foreign" tag turn red. I just double clicked every cell and the entire "foreign" column is now red. I attached the file. Does this happen on your end as well? It's not a huge deal, the sheet is still functional. But it would be nice if they didn't change color.
    Attached Files Attached Files

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

    Re: Filter Cells using Checkboxes

    Sorry again. That was a conditional format experiment: If a movie was tagged with more than one language the cells turned red to indicate a possible mistake. Just select conditional formatting and "clear all".
    Attached Files Attached Files
    Last edited by protonLeah; 01-13-2021 at 09:06 PM. Reason: added file

  18. #18
    Registered User
    Join Date
    01-08-2021
    Location
    USA
    MS-Off Ver
    2007
    Posts
    15

    Re: Filter Cells using Checkboxes

    Thank you! This is great!

    So I ended up with way more tags than I thought I would and it’s making the table hard to read. To fix this, here is what I’d like: When a filter is applied, I want it to only display the columns where a * appears for any of the displayed films. I attached my current sheet showing an example (the file size is over the 1MB limit for xlsm files so I had to zip it.) As you can see, when I check the “1960s” and “Foreign” tags and apply the filter, the only two films that are displayed are “100 Cries Of Terror” and “A Study In Terror”. However, the sheet shows all of the columns even though most of them don’t have a *. The only columns that have a * for either of these two films are the following:
    1960s
    Foreign
    Mexican
    British/UK
    One Thumb
    OK
    B&W
    Thriller
    Mystery
    Jack The Ripper

    Is there a way to only display these columns rather than displaying all of the columns since most of them lack an * and don't apply to these two films? This would make the table much easier to read. And obviously, I would want the sheet to do this for any filter that is applied; what I gave above is just an example. Again, thank you so much for all the help! I really appreciate it!
    Attached Files Attached Files

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

    Re: Filter Cells using Checkboxes

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by protonLeah; 01-20-2021 at 01:41 AM.

  20. #20
    Registered User
    Join Date
    01-08-2021
    Location
    USA
    MS-Off Ver
    2007
    Posts
    15

    Re: Filter Cells using Checkboxes

    Thank you for all your hard work! This is definitely on the right track, but this seems to eliminate too much. It looks like the filter eliminates all columns except for the ones that are checked. Continuing to use the example I gave above, if I check the “1960s” and “Foreign” tags and apply the filter, the only two films that are displayed are “100 Cries Of Terror” and “A Study In Terror” (which is correct). The problem is that the only columns that are displayed are the two that are checked: “1960s” and “Foreign”. But all of these tags apply to at least one of those two films:
    1960s
    Foreign
    Mexican
    British/UK
    One Thumb
    OK
    B&W
    Thriller
    Mystery
    Jack The Ripper

    So all of those columns should be visible when the filter is applied, not just the two that were checked. I only want the completely empty columns to be removed. That is, columns where no * appears for any of the films that are displayed when the filter is applied.

    Another kind of odd thing that is happening, if I check "USA" and "One Thumb", I get this (see attached image). The "One Thumb" tag text is gone, but the *s still appear below it. But in the next column, "Two Thumbs" appears even though that tag wasn't checked. I thought it might have something to do with the "format control/move or size with cells" option, but it appears all the check boxes are set to "move but don't size" so that must not be it.
    Attached Images Attached Images

  21. #21
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2407 (Windows 11 23H2 64-bit)
    Posts
    83,216

    Re: Filter Cells using Checkboxes

    Quote Originally Posted by torachan View Post
    HELP !!! Please.
    Here is where you can call for help: https://www.excelforum.com/the-water...ry-2021-a.html
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

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

    Re: Filter Cells using Checkboxes

    I've added a new sub, although this seems contrary to the original request:
    Please Login or Register  to view this content.
    Attached Files Attached Files

  23. #23
    Registered User
    Join Date
    01-08-2021
    Location
    USA
    MS-Off Ver
    2007
    Posts
    15

    Re: Filter Cells using Checkboxes

    This does exactly what I want it to do! The original request was to filter out any movies that don't satisfy all of the checks. So if I check “1960s” and “Foreign” I want it to only display films that satisfy both of those conditions. But once those films are displayed, I still want to see all of the tags that apply to these two films (regardless of if I specifically checked those tags). So once it displays the two films “100 Cries Of Terror” and “A Study In Terror”, I can now also see all the other tags that apply to those films. This is exactly what I want! Thank you!

    The "One Thumb" and "Two Thumb" tag text error that I mentioned in my last post is still happening though. Here are some examples (I attached the sheet for each example with the checks pre-selected)
    Example 1: If I check the "One Thumb" tag, the tag text is gone, but the *s still appear below it as they should.
    Example 2: If I check the "Two Thumbs" tag, the tag text is gone, but the *s still appear below it as they should.
    Example 3: If I check the "Three Thumbs" tag, the tag text is there and the the *s still appear below it as they should, but there is a blank column to the left. This blank column appears a lot regardless of what tag is checked.

    Other issues:
    In tag columns: There are two "Ed Wood" tags and two "Tobe Hooper" tags.
    In tag rows: There is double/overlaying text for the "Scooby Doo", "Creepy Kid", and "Clown" tags.

    I didn't delete any of these duplicates because I didn't want to mess anything up! I didn't know if it mattered which one I deleted, etc. Once these issues are resolved, I think that should be it! Thank you so much for your patience, I know there has been a lot involved here... But I really do appreciate it!

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

    Re: Filter Cells using Checkboxes

    Please test the latest mods:
    Attached Files Attached Files

  25. #25
    Registered User
    Join Date
    01-08-2021
    Location
    USA
    MS-Off Ver
    2007
    Posts
    15

    Re: Filter Cells using Checkboxes

    Yes! This works! Thank you so much!

    I've thought of a couple other features I'd like to have added:

    1. Could you please add a counter to cell A1 for how many films are displayed? So when no filter is applied, it displays however many film entries there are. Then, when a filter is applied, have it display however many titles are displayed with that particular filter applied.

    2. Also, could you please make the sheet automatically go to the top left once the "Apply Filter" button is pressed? As it is now, if I am farther down the sheet and/or to the right when I press "Apply Filter", it remains at that same position in the sheet and I have to scroll up and/or to the left to see the results. I'd like it to automatically take me to the top left once I hit "Apply Filter" so I can see the full list of results starting from the top.

    3. Can you please remove the pop-up box that says "DoubleClick to select/deselect option" when you select one of the cells?

    I've attached my current sheet. I've added some tags, rearranged their order, and added some new film title entries so please add the above features to this current sheet. Thank you so much for all your help!
    Attached Files Attached Files
    Last edited by MovieBuff; 02-23-2021 at 02:47 PM.

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

    Re: Filter Cells using Checkboxes

    1. In A1 (change font color):
    Please Login or Register  to view this content.
    2. To select A1, add:
    Range("A1").Select
    to Subs RowFilter and ShowAll just before the End Sub lines

    3. To delete the popup
    1. ) select a cell with the pop-up message
    2. ) select data validation
    3. ) check the apply changes to all box
    4. ) clear all

  27. #27
    Registered User
    Join Date
    01-08-2021
    Location
    USA
    MS-Off Ver
    2007
    Posts
    15

    Re: Filter Cells using Checkboxes

    Thank you! #1 and #3 work. But #2 just selects cell A1, it doesn't change the scroll position of the sheet. This is because the first two rows are set to always be displayed since those rows have the tags and apply/clear filter buttons. So that cell is always being displayed anyway. Is there a way to make the sheet scroll all the way to the top and to the left when the apply filter button is pressed? Thanks again.

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

    Re: Filter Cells using Checkboxes

    Try: Range("C3"). Select (or B3 if you want the first title)

  29. #29
    Registered User
    Join Date
    01-08-2021
    Location
    USA
    MS-Off Ver
    2007
    Posts
    15

    Re: Filter Cells using Checkboxes

    I thought of that myself, actually! But the problem is that row 3 may not be displayed depending on which filter is selected. It works if the movie in row 3 is one being displayed when the filter is applied, but it doesn't work if that row is not being displayed. So it doesn't seem like selecting any certain cell will always work because of the way the macros work with hiding certain entire rows. We need to use some kind of "scroll all the way up and to the left" function (if there is such a thing!). Or somehow tell it to select whatever the first row is that's being displayed when the filter is applied, which will change depending on which check box is selected. So BX where X stands for whatever the first row is that's being displayed.

    EDIT: I got it! I added: "Application.Goto Reference:=Range("a1"), Scroll:=True" to Subs RowFilter and ShowAll just before the End Sub lines and that worked!
    Last edited by MovieBuff; 02-27-2021 at 09:04 PM.

+ 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. VBA Filter for all sheets (checkboxes)
    By MartinV10 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-27-2019, 11:26 AM
  4. Filter scrambles my checkboxes
    By jamie_sangster in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-18-2018, 05:43 PM
  5. [SOLVED] Multiple Checkboxes to filter
    By Ashley.Martin100208 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 12-17-2014, 10:33 AM
  6. Using checkboxes to filter a list
    By Pete1989 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-15-2014, 06:57 PM
  7. [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