+ Reply to Thread
Results 1 to 5 of 5

Running an Advanced Filter using Userform check boxes

  1. #1
    Registered User
    Join Date
    10-16-2010
    Location
    Cambridge
    MS-Off Ver
    Excel 2003
    Posts
    3

    Question Running an Advanced Filter using Userform check boxes

    Hi, could someone please help.

    I have created a userform with 6 check boxes and labels which relate to the content of columns D and P in a table. The user can select any combination of these check boxes. There are also 2 command buttons; one to Enter and one to Cancel.

    [x] London store (Column D)
    [ ] Cambridge store (Column D)
    [ ] Bananas (Column P)
    [x] Oranges (Column P)
    [x] Apples (Column P)
    [ ] Pears (Column P)

    What I would like to happen is for the check boxes to define the criteria for an advanced filter. For example, if the user were to select check boxes 1, 4 and 5, the table would be filtered to show only the rows that contain 'London store' and 'Oranges' OR 'London Store' and 'Apples'.

    What I'm struggling with is the code to put behind the user form, check boxes and command buttons. Also, 6 checkbox choices = 64 possible combinations so I'm assuming I need to have a spearate criteria table showing all 64 combinations for the adv filter to look at?

    Help on any of the above will be very gratefully received
    Last edited by gr6au; 08-21-2011 at 05:13 PM.

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Running an Advanced Filter using Userform check boxes

    About your control

    If 1, 4, and 5 are checked, it will show store = London and product = Oranges or Apple

    if 1 and 4 are checked, store = London and product = Oranges

    if 1, 3, 4, 5 & 6 are checked, everything in the London store will be shown. Correct?

    What should be shown if only 1 is checked? Nothing?
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Running an Advanced Filter using Userform check boxes

    Rather than checkboxes, you could use multi-select listboxes as in the attached.
    Attached Files Attached Files

  4. #4
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Running an Advanced Filter using Userform check boxes

    Cross post
    http://www.ozgrid.com/forum/showthread.php?t=157395

    Please read the link in my signature about cross posting.

  5. #5
    Registered User
    Join Date
    10-16-2010
    Location
    Cambridge
    MS-Off Ver
    Excel 2003
    Posts
    3

    Smile Re: Running an Advanced Filter using Userform check boxes

    Thank you. You sir, are a true gentleman.

    Point taken about cross-posting (Yes, I did make it to the end!)

+ 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