+ Reply to Thread
Results 1 to 5 of 5

Searchbox/Searchbutton not finding data in userform listbox

  1. #1
    Registered User
    Join Date
    05-31-2023
    Location
    Amsterdam
    MS-Off Ver
    2016
    Posts
    11

    Searchbox/Searchbutton not finding data in userform listbox

    I am building a userform to sture/edit/delete/search data. However, I've ran into a problem regarding the search button. I have built a command box that lets me select a certain column in which I want to search. if i select a column I can type in the searchbar and in the box below it live updates as I am typing. if you see the right value you can double click and it copies it to the searchbar. So far so good. However if I now click search it says 'no records found' which it is only supposed to do if there's no actual record with that value. It works for some values of the column 'Dossier' in the real file. But it does not seem to work for other columns at all. Anyone have solution?

    Userform code vba (without edit Sub to save space):

    Please Login or Register  to view this content.
    Module1 Code vba (without the submit Sub to save space):
    Question form.xlsmQuestion form.xlsm
    Please Login or Register  to view this content.
    Last edited by Excelhelp_0912; 07-05-2023 at 10:21 AM.

  2. #2
    Valued Forum Contributor MikeVol's Avatar
    Join Date
    12-30-2020
    Location
    Odessa / Ukraine
    MS-Off Ver
    MSO Prof Plus 2021 x64 (En)
    Posts
    578

    Re: Searchbox/Searchbutton not finding data in userform listbox

    Hello @Excelhelp_0912.
    When the selected column is "Dossier", an exact match filter criteria is used in the following line of code:
    Please Login or Register  to view this content.
    To troubleshoot this issue, you can try using exact match filtering for all columns, as follows:
    Please Login or Register  to view this content.
    I checked and now everything is found. Good luck.
    Last edited by MikeVol; 06-23-2023 at 04:01 AM. Reason: Update

  3. #3
    Registered User
    Join Date
    05-31-2023
    Location
    Amsterdam
    MS-Off Ver
    2016
    Posts
    11

    Re: Searchbox/Searchbutton not finding data in userform listbox

    Hi MikeVol,

    I tried changing my line of code with your line of code but i keep having issues. Should the if /else if statement change as well? this might be a very obvious issue but i'm in too deep i think. What should change about the code below?

    Please Login or Register  to view this content.

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

    Re: Searchbox/Searchbutton not finding data in userform listbox

    Have a trial with the attached - all the code is confined to the UserForm - any questions post back on this site.
    Attached Files Attached Files
    Torachan,

    Mission statement; Promote the use of Tables, Outlaw the use of 'merged cells' and 'RowSource'.

  5. #5
    Registered User
    Join Date
    05-31-2023
    Location
    Amsterdam
    MS-Off Ver
    2016
    Posts
    11

    Re: Searchbox/Searchbutton not finding data in userform listbox

    Thanks for the time and effort. I solved it in a less efficient way but it still works fine.

+ 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. resize the listbox & userform based on populated data in listbox
    By Mussa-A in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-03-2022, 09:14 AM
  2. Replies: 1
    Last Post: 04-12-2022, 04:38 PM
  3. [SOLVED] copy data from a userform listbox to Combobox on different userform
    By scouse13 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-19-2020, 01:09 PM
  4. [SOLVED] Create Macro, Userform or a searchbox to search data from table in excel in diff sheets
    By hanif in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 03-25-2014, 06:21 AM
  5. Transfer Data From One Userform Listbox to Another Userform Listbox with 11 columns
    By sparkoft in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 05-18-2013, 10:54 AM
  6. 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
  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

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