+ Reply to Thread
Results 1 to 6 of 6

Listbox not showing all the data needed

  1. #1
    Registered User
    Join Date
    09-27-2019
    Location
    England
    MS-Off Ver
    Office 365
    Posts
    3

    Listbox not showing all the data needed

    Hello,

    I'm currently using a Textbox and a listbox to make a search form for my spreadsheet.
    Currently you can search using any of the data in a row and it'll pull one line to the listbox, but won't show any duplicates with slightly different information etc.

    I need it to show any data matching any of the cells.

    Can anyone help me?

    Please Login or Register  to view this content.
    Thanks guys
    Last edited by KH97; 10-01-2019 at 08:46 AM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Listbox not showing all the data needed

    Welcome to the Forum KH97!

    The issue seems to be "duplicates with slightly different information". If they have slightly different information, they are not duplicates. Your code looks for a case-insensitive exact match. What do you want instead?

    By the way, the If statement logic is redundant. The current line of code is

    Please Login or Register  to view this content.
    but you can get identical results with

    Please Login or Register  to view this content.
    Also, it would enhance the readability of the code if it were indented to show structure.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    09-27-2019
    Location
    England
    MS-Off Ver
    Office 365
    Posts
    3

    Re: Listbox not showing all the data needed

    Thanks for the reply 6String.

    Currently on my spreadsheet the columns are:

    Company - Centre Number - Product Code - Quantity - Notes

    And i have multiple different lines going in with the same Centre number and same company.
    But when i use the textbox to search it only pulls back one line from one of the orders.

    For example in the spreadsheet i have the lines:

    UKD - 101 - 105A
    UKD - 101 - 105B

    But if i search UKD or 101 i will only get one of those lines back and i need to be able to pull anything to do with what i'm searching back.

    If that makes sense.

    Thanks

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

    Re: Listbox not showing all the data needed

    Welcome to the forum

    Please attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    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.

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

    Re: Listbox not showing all the data needed


  6. #6
    Registered User
    Join Date
    09-27-2019
    Location
    England
    MS-Off Ver
    Office 365
    Posts
    3

    Re: Listbox not showing all the data needed

    Quote Originally Posted by Kyle123 View Post
    Try this:
    Cheers Kyle123, you're a legend.

    And thank you everyone else who replied i really appreciate it.

+ 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. Showing search result in listbox
    By Mahmoudelnemr in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-21-2019, 07:45 AM
  2. Listbox showing data searched in a sheet using the given combobox value
    By minominuccio in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 11-21-2017, 10:34 AM
  3. ListBox Is not showing Headers (UserForm)
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 07-30-2017, 08:38 AM
  4. Not showing value time in TextBox and ListBox
    By Seeuw in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 12-14-2013, 06:27 AM
  5. Listbox to Listbox, no duplicates & submitting same UserForm data for each Listbox entry.
    By jamieswift1977 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-18-2012, 12:18 PM
  6. Listbox is showing data from outside the range set?
    By Smurlos in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-21-2010, 08:41 AM
  7. Showing data from specific columns in a listbox
    By Smurlos in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-21-2010, 11:13 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