+ Reply to Thread
Results 1 to 5 of 5

Filtering a Listbox with a textbox in a userform

  1. #1
    Registered User
    Join Date
    09-27-2007
    Location
    Staten Island, NY
    MS-Off Ver
    Office 2013
    Posts
    64

    Filtering a Listbox with a textbox in a userform

    Hey all. I have been trying for days, read other posts, and can't get this to work.

    I have a user form. On this form there is a listbox named Values. This box has it's data RowSource set to 'Costsrt'!B5:B1171.
    I have a TextBox above it labeled Search_Box.

    What I want, is being that I have 1166 entries, to be able to type into the search box, and as I type, it will only keep the lines that include
    what I am typing. So if I type safety for example, then the only lines it should show are lines that contain the word safety in it.

    Can anyone help me with this? I tried and can't get it to work.

    Also, I see a lot of posts saying to use the command line Me.RefreshList

    If I put this in, I always get an error. Is this an old line? After Me. I don't even have that as a valid choice.

    Thanks in advance!!


    Cross post Here: http://www.mrexcel.com/forum/excel-q...-userform.html

  2. #2
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Filtering a Listbox with a textbox in a userform

    Don't use RowSource, it's a horrible property, this is case sensitive, you you need case insensitive it's a little more complex:
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    09-27-2007
    Location
    Staten Island, NY
    MS-Off Ver
    Office 2013
    Posts
    64

    Re: Filtering a Listbox with a textbox in a userform

    Thanks for the response! Ill let you know how it works!

  4. #4
    Registered User
    Join Date
    09-27-2007
    Location
    Staten Island, NY
    MS-Off Ver
    Office 2013
    Posts
    64

    Re: Filtering a Listbox with a textbox in a userform

    It works, but it is case sensitive. How can I make it non case sensitive?

    Thanks again!!

  5. #5
    Registered User
    Join Date
    09-27-2007
    Location
    Staten Island, NY
    MS-Off Ver
    Office 2013
    Posts
    64

    Re: Filtering a Listbox with a textbox in a userform

    Got it. I copied the column to v as all lowercase
    And added lcase to the searchbox item. Works
    Perfect. When I double click the item it uses the B
    Column for the auto fill.
    Thanks for the help!!

+ 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] populate userform listbox from textbox input
    By cfinch100 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-05-2013, 10:05 AM
  2. listbox filtering via textbox
    By nemmi69 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-12-2012, 04:23 AM
  3. fill a listbox from textbox of other tab of userform in excel vba
    By kmlprtsngh in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-22-2010, 03:36 AM
  4. Filtering data to a userform listbox
    By Kryer in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-03-2005, 06:05 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