+ Reply to Thread
Results 1 to 4 of 4

Filter listbox by value in textbox on userform

  1. #1
    Registered User
    Join Date
    07-13-2018
    Location
    Manchester, England
    MS-Off Ver
    2010
    Posts
    7

    Filter listbox by value in textbox on userform

    Hi Guys,

    I am sure the solution is more simple that I am trying to make it but here is my problem!

    I have a userform that holds a textbox called cboClientRef. The user is prompted to fill this in. I have a worksheet named Status with the ClientRef being the first column (A) for over 8,500 - many will be duplicated and thats what I need - with information that I need for each entry on the next 20 or so columns.

    What I want to be able to do is have a listbox on the userform which as they user types the client reference number in the cboClientRef combo box, filters out only those records where the Client Reference number matches, and displays that along with the next 4 columns.

    I would be very grateful for any pointers on this one!

    Many thanks

    Rob

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Filter listbox by value in textbox on userform

    There are several approaches to this.

    Possibly the easiest is using the excel filter function.

    1. Use the Textbox to type the client reference.

    2. List all matching client names in the listbox

    Please Login or Register  to view this content.
    3. Click on the listbox to select your client reference.

    4. Copy client reference to textbox

    5. filter your data

    6. Copy the filtered data to a temporary location.

    7. Copy the data from temporay are to list box.
    Last edited by mehmetcik; 07-20-2018 at 01:57 PM.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Filter listbox by value in textbox on userform

    Welcome to the forum!

    I did that sort of thing in this code. Change sheet name, column count, and control names to suit.

    In the Userform:
    Please Login or Register  to view this content.
    In a Module, paste and add references:
    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Filter listbox by value in textbox on userform

    I had issues with my listbox

    So I had to use two listboxes one on top of the other


    Please Login or Register  to view this content.
    Attached Files Attached Files

+ 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] How to filter a table using textbox and show filtered data in listbox (userform)
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-01-2017, 10:31 AM
  2. Filter UserForm Multicolumn ListBox with TextBox/ComboBox
    By Alex.riccio in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-07-2016, 03:12 PM
  3. Filter UserForm Multicolumn ListBox. populated by RowSource. with TextBox/ComboBox
    By Alex.riccio in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-07-2016, 10:19 AM
  4. [SOLVED] Filter UserForm Multicolumn ListBox with TextBox/ComboBox
    By Alex.riccio in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-06-2016, 04:31 PM
  5. VBA - Userform - Listbox validation and Listbox to Textbox
    By stevefisher85 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-04-2016, 07:11 AM

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