+ Reply to Thread
Results 1 to 12 of 12

Search in UserForm and Display in ListBox

  1. #1
    Registered User
    Join Date
    10-25-2019
    Location
    Philippines
    MS-Off Ver
    2013
    Posts
    13

    Post Search in UserForm and Display in ListBox

    Good day, i am new in VBA and i want to start a new VBA project.
    what i wish to do is a userform with search button and display multiple result in listbox.
    i dont know where to start. i tried using Instr function but still i am no good
    please help me.
    thanks

  2. #2
    Valued Forum Contributor dotchiejack's Avatar
    Join Date
    05-21-2015
    Location
    Antwerp,Belgium
    MS-Off Ver
    2016
    Posts
    507

    Re: Search in UserForm and Display in ListBox

    See example.
    It works with table called data_tbl
    The 2 textboxes are called T_00 and T_01
    The Listbox is called LB_00
    Articles that do not meet the search criteria will be removed from the list.
    If you have difficulties post a small example of your file.
    Attached Files Attached Files
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    10-25-2019
    Location
    Philippines
    MS-Off Ver
    2013
    Posts
    13

    Re: Search in UserForm and Display in ListBox

    Here is my sample data. thanks
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor dotchiejack's Avatar
    Join Date
    05-21-2015
    Location
    Antwerp,Belgium
    MS-Off Ver
    2016
    Posts
    507

    Re: Search in UserForm and Display in ListBox

    What do you want to search, Name?

  5. #5
    Registered User
    Join Date
    10-25-2019
    Location
    Philippines
    MS-Off Ver
    2013
    Posts
    13

    Re: Search in UserForm and Display in ListBox

    I want to search for name.
    Thank you very much for assistance

  6. #6
    Valued Forum Contributor dotchiejack's Avatar
    Join Date
    05-21-2015
    Location
    Antwerp,Belgium
    MS-Off Ver
    2016
    Posts
    507

    Re: Search in UserForm and Display in ListBox

    Search the name, click in the list on the correct name.
    You can fill the searchsheet with the result.
    Attached Files Attached Files

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,516

    Re: Search in UserForm and Display in ListBox

    jaylyn_cpa

    Do you need a CommadButton???
    Please Login or Register  to view this content.
    Attached Files Attached Files

  8. #8
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,302

    Re: Search in UserForm and Display in ListBox

    Hi.
    Try the attached, I have replace your textbox with a combobox.
    This is populated with uniques from your 'register'
    The 'register' is now in 'table' format as this expands your updating of the combobox is automatic.
    torachan.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    10-25-2019
    Location
    Philippines
    MS-Off Ver
    2013
    Posts
    13

    Re: Search in UserForm and Display in ListBox

    hello, thank you for this but there is a little problem, when i search on search box, date in listbox is not appearing.
    Attachment 647222

  10. #10
    Registered User
    Join Date
    10-25-2019
    Location
    Philippines
    MS-Off Ver
    2013
    Posts
    13

    Re: Search in UserForm and Display in ListBox

    Quote Originally Posted by dotchiejack View Post
    Search the name, click in the list on the correct name.
    You can fill the searchsheet with the result.
    Sir when i search and click, date is not shown. thanks

  11. #11
    Registered User
    Join Date
    10-25-2019
    Location
    Philippines
    MS-Off Ver
    2013
    Posts
    13

    Re: Search in UserForm and Display in ListBox

    Quote Originally Posted by torachan View Post
    Hi.
    Try the attached, I have replace your textbox with a combobox.
    This is populated with uniques from your 'register'
    The 'register' is now in 'table' format as this expands your updating of the combobox is automatic.
    torachan.
    Thank you for this.

  12. #12
    Registered User
    Join Date
    10-25-2019
    Location
    Philippines
    MS-Off Ver
    2013
    Posts
    13

    Re: Search in UserForm and Display in ListBox

    Quote Originally Posted by jindon View Post
    jaylyn_cpa

    Do you need a CommadButton???
    Please Login or Register  to view this content.
    Thanks for this, im gonna use it for reference

+ 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. Using a listbox to display search results in a userform.
    By aayush_1231 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-28-2019, 05:11 AM
  2. [SOLVED] Search in listbox, don't display empty
    By Bandito1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-13-2019, 09:33 AM
  3. Problems with listbox display and search button with the userform
    By SpArKy999 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-04-2017, 04:21 AM
  4. Search Multiple Worksheets using a Userform and display in listbox.
    By nathandavies in forum Excel Programming / VBA / Macros
    Replies: 29
    Last Post: 11-18-2014, 10:22 AM
  5. [SOLVED] Search and display results to listbox
    By khhoa in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-17-2014, 05:05 AM
  6. [SOLVED] Userform Search and Display rows in ListBox
    By Nu2Java in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-13-2012, 10:15 PM
  7. Display a UserForm based on Data selected in another UserForm's ListBox
    By RPhilbin83 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-26-2011, 11:35 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