+ Reply to Thread
Results 1 to 6 of 6

Filter Listbox Values based on Textbox input

  1. #1
    Registered User
    Join Date
    01-24-2013
    Location
    Den Haag, The Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    25

    Filter Listbox Values based on Textbox input

    Hi!

    This will be my first question on this forum. Looking forward to the responses.
    I'm facing some problems with a small project i'm working on, see the attached sample file.

    I need to search all fields in a table named 'Contact' using textbox input.
    This search should real-time filter items in a lisbox on the same userform.

    I've googled a lot and found some examples, but it did not quite match the results i need.
    I need to be able to type whatever info in the textbox and it should find and show the matching names in the listbox.
    So for example i should be able to type a phone number, e-mail, name, etc and it would show the matching names

    I got part of it working for a simple textbox result using the FIND method. Now i need help to translate that to the listbox.

    I hope it makes sense!
    Attached Files Attached Files
    Last edited by redocs; 07-17-2013 at 04:51 AM.

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

    Re: Filter Listbox Values based on Textbox input

    Would you like it case sensitive or case insensitive?

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

    Re: Filter Listbox Values based on Textbox input

    Assuming lowercase:
    Please Login or Register  to view this content.
    It stops being perfectly smooth at around 10k rows on my machine, but it's still very useable - I've tested it up to 30k rows

  4. #4
    Registered User
    Join Date
    01-24-2013
    Location
    Den Haag, The Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: Filter Listbox Values based on Textbox input

    Thanks!

    I cracked the nut myself (just 1 minute ago) using the below code. Any comments on this solution are welcome. I am eager to learn

    Please Login or Register  to view this content.

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

    Re: Filter Listbox Values based on Textbox input

    Your code is solid enough , but will get very slow with a lot of entries. Try dragging your data down to about 10k rows - if you never have many the it's not a problem though

  6. #6
    Registered User
    Join Date
    01-24-2013
    Location
    Den Haag, The Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: Filter Listbox Values based on Textbox input

    Tried it with 20k rows and yes.... it becomes very slow indeed.

    I dont expect to have more than 1k of rows though.

    Thanks for your input!

+ 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] excel vba filter values to listbox from combobox and save edit values in textbox
    By breadwinner in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-03-2013, 08:42 AM
  2. [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
  3. VBA listbox based on value in textbox
    By excelvraag in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-16-2012, 11:11 AM
  4. combining listbox values to a textbox
    By st0kvis in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-25-2011, 06:55 AM
  5. update data based on listbox & textbox
    By SarahPintal in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-13-2010, 02:37 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