+ Reply to Thread
Results 1 to 4 of 4

Filter columns by typing text in a search box?

Hybrid View

  1. #1
    Registered User
    Join Date
    01-28-2016
    Location
    Leamington Spa
    MS-Off Ver
    2007
    Posts
    14

    Filter columns by typing text in a search box?

    Hi Guys, basically I want to be able to filter columns in a table by searching with text, rather than the cumbersome drop down filter built in to Excel.

    (See attached)

    The idea is to have a search box above each column.

    For example if I were to type "S" into the A column search box and press enter, this would then filter out all rows which do not contain "S"

    Then I can move to the next box and filter further.


    I am looking for the exact same functionality as is already available through the filter built into excel with drop down menus, but I need to be able to type for quick access.

    Any help or advice you can all give me would be much appreciated!

    Mickey
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    12-05-2015
    Location
    Akron, OH
    MS-Off Ver
    15.0
    Posts
    424

    Re: Filter columns by typing text in a search box?

    How familiar are you with VBA? I just did a project exactly like that today: http://www.excelforum.com/excel-prog...ed-filter.html

    You would just need to change the relevant parameters (the worksheet name you're searching in, firstrow, firstcolumn, a few ranges, a few .Offset arguments, Range arguments, etc.), insert a row to place a Macro button (that would be located in row 3), and insert a blank row for search fields (row 4). Most of the work done to develop the code from the macro I posted in the link above is copy and paste. I try to be as explicit as possible when I code, so you should be able to solve this problem with little-no guidance beyond the above post.

    Let me know if you have any questions.
    Last edited by joe31623; 02-03-2016 at 04:14 PM.
    <---If my answer helped, please click *

  3. #3
    Registered User
    Join Date
    01-28-2016
    Location
    Leamington Spa
    MS-Off Ver
    2007
    Posts
    14

    Re: Filter columns by typing text in a search box?

    Hi thanks for the quick reply, I am not at all familiar with VBA unfortunately - part of my problem!

    I was hoping for the ability to run the macro just by hitting enter - kind of imagine the same as google?

    Allternatively, what would also be useful is one search box where I can enter multiple search criteria and run one macro to filter all the columns. Its really about ease and speed, aimed at people who are terrible at computers (even more than me)!

  4. #4
    Forum Contributor
    Join Date
    12-05-2015
    Location
    Akron, OH
    MS-Off Ver
    15.0
    Posts
    424

    Re: Filter columns by typing text in a search box?

    Mickey,
    yep... that's what my solution does. It wouldn't be too difficult to create a search based on an arbitrary number of criteria separated by commas (such as: "A, B, C").


    VBA can be challenging if you have no guidance. I'll be happy to break it down for you what you can do in 10 easy-to-follow tasks to help me finish this for you. Although it doesn't seem like you're doing much, it will help me because a lot of the work I'll be doing is copying and pasting.

    If you complete the following steps, I'll take care of it for you before I go to bed tonight (or the following day in which you complete it).

    Step 1: Open up the workbook you uploaded.
    Step 2: Open up the VBA editor (this may sometimes be done by hitting: Alt + F11)
    Step 3: Create a new module (right click on the Project - VBA Project window - click Insert - click New Module): http://www.cpearson.com/excel/codemods.htm or https://www.youtube.com/watch?v=KHO5...3akx_gFMnpxTN5
    Step 4: Copy and Paste my code that is shown in the post I listed above into the module you created
    Step 5: Delete all macros except: Sub FilterConsequence() and Sub resetwb()
    Step 6: Change each line with a comment: 'change "E" when changing macro to the right of the line of code to have an "A" instead of a "G" in the Range argument(WS_Raw.Range("G" & firstrow) should be WS_Raw.Range("A" & firstrow) when you're done)
    Step 7: Change the line with a comment: 'change 5 when changing macro (though... this probably doesn't matter) to have a 1 instead of 7 in the Cells argument
    Step 8: Change the line with a comment: 'change offset when changing macro so that RNG_DisDat.Offset(0, -6).Resize(1, DatLen_cl)) is RNG_DisDat.Resize(1, DatLen_cl))

    Step 9: Insert two blank lines between your drop down list and where the data begins (one for the search button and one for the test you'll search for)
    Step 10: Upload the document to the forum

    And that's it! I'll take it from there...

+ 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. search typing mistaken number
    By sanju2323 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-03-2016, 11:29 AM
  2. Text Box value to search/filter a table
    By padawanexcellwarrior in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-19-2015, 10:59 PM
  3. Advanced Filter to show desired text or numbers typed in a search box
    By GabrielAlin in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 03-24-2015, 01:04 AM
  4. [SOLVED] Search through columns and find specific text and replace that text with header column
    By adamzee in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-09-2014, 11:59 PM
  5. Search by typing in first letter into dropdown box
    By kathhear in forum Excel General
    Replies: 2
    Last Post: 03-15-2013, 03:46 AM
  6. command to filter multiple columns and search for words containing keywords
    By melvyndb in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-11-2012, 09:37 PM
  7. Excel 2007 : Filter data in the same time you typing
    By darklight86 in forum Excel General
    Replies: 1
    Last Post: 01-11-2012, 08:41 PM

Tags for this Thread

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