+ Reply to Thread
Results 1 to 6 of 6

Filtering Search Box with 2 or more variables.

  1. #1
    Registered User
    Join Date
    08-14-2017
    Location
    MX
    MS-Off Ver
    2011 Mac Excel Ver 14.6.6
    Posts
    18

    Filtering Search Box with 2 or more variables.

    I'm using a template from "The Spreadsheet Guru" that helps you filter data from a table according to what you type and what column you indicate the search to run.

    The thing is that the code only lets you filter 1 variable and I would like to filter 2 or more variables having multiple options. Sometimes I get error 400, sometimes I get results (still not obeying the filter options) and sometimes I get blank results.

    Not sure what I'm missing, I'm stating that the Macro needs to run all 3 text boxes to do the filter but it doesn't.

    For last, I state that at the end of each search, the buttons should become False, but it only does the first one.

    Apologies for many threads I'm opening, but I'm working (practicing) on multiple ones at the same time.

    Regards,
    Attached Files Attached Files

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,860

    Re: Filtering Search Box with 2 or more variables.

    I have removed the txt boxes you were using for criteria and placed the criteria in Cells B1,D1 and E1 and then used the following code

    Please Login or Register  to view this content.
    To clear the criteria, I assigned the following code to that button
    Please Login or Register  to view this content.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,167

    Re: Filtering Search Box with 2 or more variables.

    Hi DanPa

    Another option making use of Alan's idea....
    Option Buttons which allows choice of filter i.e. car only, Car & Color, Car&Color&Year...
    Perhaps someone else can simplify...
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  4. #4
    Registered User
    Join Date
    08-14-2017
    Location
    MX
    MS-Off Ver
    2011 Mac Excel Ver 14.6.6
    Posts
    18

    Re: Filtering Search Box with 2 or more variables.

    Hi again.

    I apologize for replying so late, went to bed early. I will work with this two examples you kindly provide me and will come back with the results.

    Thank you

  5. #5
    Registered User
    Join Date
    08-14-2017
    Location
    MX
    MS-Off Ver
    2011 Mac Excel Ver 14.6.6
    Posts
    18

    Re: Filtering Search Box with 2 or more variables.

    Ok, so I'm working with Alans' code, I can't get it to run as I want to but I'm also not getting any errors. Removing the TextBox was great idea, less mess in the workbook.

    Now there is two things I think I'm messing that is not making this work.

    I want to change the radio buttons for checking buttons. If checking button is = true, then the Macro includes that variable in the search, otherwise it does not. But I'm not sure how to change this one.

    Sintek, your option is very good but I have trouble if I want a different combination of options to be included in the filter.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by DanPa; 08-16-2017 at 04:10 PM.

  6. #6
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,167

    Re: Filtering Search Box with 2 or more variables.

    Try this...Rather unusual
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by sintek; 08-17-2017 at 04:22 AM.

+ 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] VBA search and assign with variables
    By vio.coman in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-13-2015, 03:49 PM
  2. [SOLVED] using IF(SEARCH with multiple variables
    By khalloran in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 12-02-2014, 11:47 PM
  3. Filtering multiple variables with one macro
    By AmalathianD in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-30-2013, 03:38 PM
  4. filtering down using multiple variables
    By LSElite in forum Excel General
    Replies: 1
    Last Post: 04-18-2013, 05:40 AM
  5. Column Filtering - two variables
    By mccolef in forum Excel General
    Replies: 0
    Last Post: 11-05-2012, 11:53 AM
  6. Filtering a spreadsheet via a search box
    By Robbo57 in forum Excel General
    Replies: 2
    Last Post: 12-12-2007, 11:26 AM
  7. Filtering Using Variables
    By Colin Vicary in forum Excel General
    Replies: 1
    Last Post: 05-25-2006, 08:15 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