+ Reply to Thread
Results 1 to 7 of 7

How to filter a table using textbox and show filtered data in listbox (userform)

  1. #1
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,080

    How to filter a table using textbox and show filtered data in listbox (userform)

    hi,
    i have a table1 in Sheet("entry")

    i want to filter table (field =3 and field =12) using textbox1 and textbox2

    this filtered data want to show in listbox

    thanx alot
    Use Code-Tags for showing your code :
    Please mark your question Solved if there has been offered a solution that works fine for you
    If You like solutions provided by anyone, feel free to add reputation using STAR *

  2. #2
    Valued Forum Contributor kasan's Avatar
    Join Date
    07-22-2009
    Location
    Riga, Latvia
    MS-Off Ver
    Excel 2010
    Posts
    680

    Re: How to filter a table using textbox and show filtered data in listbox (userform)

    Hi,
    I would do this way:
    1) load table into array
    2) loop through array and if criteria from TextBox1 and TextBox2 are met - then load data to ListBox
    Please upload sample file with your userform and some data in table1.

  3. #3
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: How to filter a table using textbox and show filtered data in listbox (userform)

    Or load entire table into ListBox and filter both columns in Listbox using RemoveItem.

    Or use AdvancedFilter to create filtered list to load into ListBox.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  4. #4
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,080

    Re: How to filter a table using textbox and show filtered data in listbox (userform)

    Hi, kasan

    here is sample workbook

    and thanx for reply
    Attached Files Attached Files
    Last edited by HaroonSid; 02-01-2017 at 09:22 AM.

  5. #5
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,080

    Re: How to filter a table using textbox and show filtered data in listbox (userform)

    Sample workbook
    Attached Files Attached Files

  6. #6
    Valued Forum Contributor kasan's Avatar
    Join Date
    07-22-2009
    Location
    Riga, Latvia
    MS-Off Ver
    Excel 2010
    Posts
    680

    Re: How to filter a table using textbox and show filtered data in listbox (userform)

    I dont know how many values you wish to add to the list box, I added 3 values. If you need more, then change ListBox column count (ColumnCount under Properties) and add values as I did it in the code.

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

  7. #7
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,080

    Re: How to filter a table using textbox and show filtered data in listbox (userform)

    Thanx A lot dear kasan

    its working perfectly

    but if i want to add 33 column in list box


+ 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. 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
  2. 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
  3. [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
  4. Copy visible cells in filtered table and paste in userform textbox - email
    By pfeifferjoey in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-29-2014, 11:23 AM
  5. Excel 2003: Userform textbox populated by table filtered results
    By SHU_STU_0609 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-16-2013, 12:53 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