+ Reply to Thread
Results 1 to 19 of 19

VBA userform search for listbox entry based on Textbox value

  1. #1
    Forum Contributor
    Join Date
    02-22-2011
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    108

    VBA userform search for listbox entry based on Textbox value

    Hi All,

    I have a listbox with 17 columns and lots of data.

    I need a code that will search a entry in the listbox based on the value of a textbox.

    I have a symple code below and it is working fine for what it is meant to do, however in my first column i have a lot of duplicate values and this code will look for the value in the first column. I need the code to look for a value in the last column of the listbox as the last column has a unique value and the textbox need to search for that value...

    Below is the symple code please help with any suggestions...

    Please Login or Register  to view this content.

  2. #2
    Forum Contributor
    Join Date
    02-22-2011
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    108

    Re: VBA userform search for listbox entry based on Textbox value

    Any idea what to do?

  3. #3
    Valued Forum Contributor
    Join Date
    09-04-2012
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    463

    Re: VBA userform search for listbox entry based on Textbox value

    download excel file from the following link and tell me is it ok for you?
    http://www.2shared.com/document/kSsNIHoy/list_box.html

    I hope it is useful for you.

    Regards
    CA Mahaveer Somani

  4. #4
    Forum Contributor
    Join Date
    02-22-2011
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    108

    Re: VBA userform search for listbox entry based on Textbox value

    Hi,

    I have difficulties downloading the file...

    Can you upload the file?

    Thanks,

  5. #5
    Registered User
    Join Date
    01-09-2013
    Location
    Vietnam
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: VBA userform search for listbox entry based on Textbox value

    Quote Originally Posted by Hilton1982 View Post
    Hi,

    I have difficulties downloading the file...

    Can you upload the file?

    Thanks,
    You can use Filter function to do this.

  6. #6
    Forum Contributor
    Join Date
    02-22-2011
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    108

    Re: VBA userform search for listbox entry based on Textbox value

    How i have tried many ways now and yet it only search for the value in the first column in the listbox?

  7. #7
    Valued Forum Contributor
    Join Date
    09-04-2012
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    463

    Re: VBA userform search for listbox entry based on Textbox value

    now you can check it
    n tell me is it your requirement?
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    01-09-2013
    Location
    Vietnam
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: VBA userform search for listbox entry based on Textbox value

    Quote Originally Posted by Hilton1982 View Post
    How i have tried many ways now and yet it only search for the value in the first column in the listbox?
    You see my example as the att.
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    02-22-2011
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    108

    Re: VBA userform search for listbox entry based on Textbox value

    Thanks Mahaveersomani,

    The sheet attached only have on column in the listbox and it is the same code i'm using currently.

    I need a code that will look for the a value in the 16th column of the listbox based on the value of the textbox?

  10. #10
    Registered User
    Join Date
    01-09-2013
    Location
    Vietnam
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: VBA userform search for listbox entry based on Textbox value

    Quote Originally Posted by Hilton1982 View Post
    Thanks Mahaveersomani,

    The sheet attached only have on column in the listbox and it is the same code i'm using currently.

    I need a code that will look for the a value in the 16th column of the listbox based on the value of the textbox?
    You can download file as below links
    http://www.ozgrid.com/VBA/listbox-filter.htm

  11. #11
    Valued Forum Contributor
    Join Date
    09-04-2012
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    463

    Re: VBA userform search for listbox entry based on Textbox value

    excuse me dear in my file
    when u write some thing related to listbox then after exit to textbox it will autolook the value in the list box.
    actually i could not understand excatly what u want please will u upload a sample workbook n explain me what u want so that i can help u excatly.

  12. #12
    Forum Contributor
    Join Date
    02-22-2011
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    108

    Re: VBA userform search for listbox entry based on Textbox value

    Mahaveersomani,

    Yes you are right i manage to get it working even if the value is in the second column it still finds the row...

    Thanks

  13. #13
    Valued Forum Contributor
    Join Date
    09-04-2012
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    463

    Re: VBA userform search for listbox entry based on Textbox value

    Welcome dear...Hilton1982

    chearup...!!!

    Regards
    CA Mahaveer Somani

  14. #14
    Registered User
    Join Date
    03-20-2013
    Location
    chicago
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: VBA userform search for listbox entry based on Textbox value

    Mahaveer,
    I am having hard time figuring out filtering. I have long list and I want to add search to that list and wanted to give me list of closets option to select from but, struggling with the code.

    Link to file:
    http://we.tl/1ZUqIOjrTk

    thanks in advance for you help!
    Nimesh
    Attached Files Attached Files

  15. #15
    Registered User
    Join Date
    08-06-2014
    Location
    USA
    MS-Off Ver
    2010
    Posts
    1

    Re: VBA userform search for listbox entry based on Textbox value

    Yeah I have the same concerns, aye Nimesh!

  16. #16
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: VBA userform search for listbox entry based on Textbox value

    nimesh29 welcome to the forum

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  17. #17
    Registered User
    Join Date
    03-20-2013
    Location
    chicago
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: VBA userform search for listbox entry based on Textbox value

    Thanks FDibbins!
    I just posted the new tread for the same subject with link to previous post.

    -Nimesh

  18. #18
    Registered User
    Join Date
    03-02-2015
    Location
    Malaysia
    MS-Off Ver
    2000
    Posts
    2

    Re: VBA userform search for listbox entry based on Textbox value

    Hi, I can't download the file. Can you please help me to post the code here?

    Thanks.

  19. #19
    Registered User
    Join Date
    02-14-2015
    Location
    Hyderabad
    MS-Off Ver
    2007
    Posts
    1

    Re: VBA userform search for listbox entry based on Textbox value

    search in a cell
    Attached Files Attached Files
    Last edited by eeswari; 03-12-2015 at 08:31 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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