+ Reply to Thread
Results 1 to 6 of 6

Search on user string and filter column

  1. #1
    Registered User
    Join Date
    11-16-2010
    Location
    Manchester
    MS-Off Ver
    Excel 2003
    Posts
    31

    Question Search on user string and filter column

    Firstly thank you to the help I've had recently from here. 1st class site and top notch mods and users.

    Now I'm getting a little ambitious.

    I have attached a VERY simple version of what I am trying to do.

    In esscence, I want the user to be able to type in a string in a search cell and then for the column to show only those cells that contain that text.

    So for instance on my attached version, if "green" was typed I want the column to only show green bottles and Green oil.

    If "Oil" was typed I want the column to shown Green oil and Blue oil and so on

    I'm sure this can be done, and a similar thread is on the first page here but isn't quite what I'm after.

    Have you got any pointers?

    Thank you
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Search on user string and filter column

    Maybe this in the worksheet module - right-click sheet tab, view code and paste:
    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Search on user string and filter column

    Another option:
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    11-16-2010
    Location
    Manchester
    MS-Off Ver
    Excel 2003
    Posts
    31

    Re: Search on user string and filter column

    As ever, problem solved.

    Stephen, your code would work but the complete list of products is huge so the code is impracticle for the Array. Sorry if I was unlcear.

    stnkynts, that code seems work just fine.

    In fact I've combined Stephen's Idea of putting the code in the change method so user doesnt have to click a button to perform the action. It just searches when you the cell loses focus.

    Thank you both.

    How do I set the thread title to [SOLVED] ?

  5. #5
    Registered User
    Join Date
    11-16-2010
    Location
    Manchester
    MS-Off Ver
    Excel 2003
    Posts
    31

    Re: Search on user string and filter column

    Ahh one slight problem I just noticed.

    Is it possible to filter using part matches. For example if the user was to type "own" in the search box then the row would filter out the "own" of "Brown Bottle"?

  6. #6
    Registered User
    Join Date
    11-16-2010
    Location
    Manchester
    MS-Off Ver
    Excel 2003
    Posts
    31

    Re: Search on user string and filter column

    Ahh, I seem to have worked that one out on my own, I changed the vbTextCompare to vbBinaryCompare and it works!!

    Again thank you

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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