+ Reply to Thread
Results 1 to 6 of 6

Search (Autofilter) Multi-Columns Using TextBoxes

  1. #1
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,009

    Search (Autofilter) Multi-Columns Using TextBoxes

    .
    Want the user to enter several different query terms in different fields (textboxes) and the autofilter macro return a match.

    Currently have two similar macros that are not providing the desired results :

    Macro #1:

    Please Login or Register  to view this content.

    Macro #2:

    Please Login or Register  to view this content.


    Please refer to additional description on Sheet 1 of workbook.

    Thank you for reading and any assistance.
    Attached Files Attached Files

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,810

    Re: Search (Autofilter) Multi-Columns Using TextBoxes

    Try the attached file. I have removed all buttons except the "Search All Columns" button. I have added another text box in column D (TextBox3) so that the text boxes are sequentially numbered from 1 to 29. In your original file, TextBox3 was missing. You don't need to use it but it is necessary for the loop in the macro to work. Just type in the criteria in the desired box or boxes and click the button. I didn't do any comprehensive testing, but in the limited testing I did, it seemed to work properly.
    Attached Files Attached Files
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,009

    Re: Search (Autofilter) Multi-Columns Using TextBoxes

    .
    Thank you Mumps !! Impressive solution.

    One of the previous resources I was attempting to utilize provided for entering a partial term for the query. Instead of "automatic" ... you could enter "auto" .. or "matic" .. or even a single letter .. "t" .

    Is this possible with the solution you provided ?

    I'm aware of using the asterisk "*" with autofilter but not aware if it is possible with this solution ? Or maybe LIKE ??

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,810

    Re: Search (Autofilter) Multi-Columns Using TextBoxes

    Try replacing this line of code:
    Please Login or Register  to view this content.
    with this line:
    Please Login or Register  to view this content.
    I entered "ll" (two L's without the quotes) in the first text box and it returned all the last names with a double "L". Also replace
    Please Login or Register  to view this content.
    with
    Please Login or Register  to view this content.
    This will leave the column headers after filtering.

  5. #5
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,009

    Re: Search (Autofilter) Multi-Columns Using TextBoxes

    .
    Thank you Mumps.

    A few quick tests and it appears to function well !

    Appreciate your assistance.

  6. #6
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,810

    Re: Search (Autofilter) Multi-Columns Using TextBoxes

    My pleasure.

+ 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. Code for multi textboxes in frame
    By ankur3020 in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 06-16-2014, 04:26 AM
  2. [SOLVED] can not search textboxes
    By cfinch100 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-26-2013, 03:24 PM
  3. [SOLVED] Match search terms, and add data in next column. Multi search problem.
    By Wales MB in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-23-2013, 06:10 PM
  4. Replies: 1
    Last Post: 05-16-2012, 07:30 AM
  5. Multi-Column Listboxes correspond to multi textboxes
    By Crebsington in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-12-2012, 01:38 PM
  6. Multi Column AutoFilter
    By friedmandillon in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-29-2010, 10:04 AM
  7. Multi Range formula from Autofilter
    By Heathcliff_3 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-01-2008, 12:16 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