+ Reply to Thread
Results 1 to 5 of 5

Userform Search when search two text boxes return multiple results

  1. #1
    Registered User
    Join Date
    07-29-2020
    Location
    Dallas, TX
    MS-Off Ver
    365
    Posts
    4

    Userform Search when search two text boxes return multiple results

    Hi,

    I'm fairly new to VBA and created a userform recently that allows users to search by first & last name, first name and by class. The first and last name each have their own text boxes. In column A, last names are entered in the sheet. In column b, first names are entered.

    For some reason, when some names are entered into the user form (first and last names), the search pulls up data on the wrong individuals. Can someone please help?

    For example. We have "Maria Alba" and "Maria Mauricio". If I enter ALBA in the Acct1/Lname text box and then enter MARIA in the Acct2/Fname text box and click SEARCH, it pulls up the name and info for "Maria Mauricio". I get similar results when I search for Lisa Jones. It renders results for Lisa Peterson.
    Attached Files Attached Files
    Last edited by nekiwa07; 09-29-2020 at 09:11 AM.

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

    Re: Userform Search when search two text boxes return multiple results

    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.

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

    Re: Userform Search when search two text boxes return multiple results

    Try this - you do not need the further groups they are repetitive and will overwrite each other.

    Please Login or Register  to view this content.
    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

  4. #4
    Registered User
    Join Date
    07-29-2020
    Location
    Dallas, TX
    MS-Off Ver
    365
    Posts
    4

    Re: Userform Search when search two text boxes return multiple results

    I've updated my post because wasn't sure if posted correctly in forum. Also updated the spreadsheet and attached. The code using is below. Still not working properly can you help?

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Last edited by nekiwa07; 09-29-2020 at 09:25 AM.

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

    Re: Userform Search when search two text boxes return multiple results

    Your file is asking me to sign up to a Microsoft service therefore I will not open it.
    Cut your file size down and upload as a .xlsm

+ 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. Text Search and Return Results ?
    By common763 in forum Excel General
    Replies: 21
    Last Post: 08-13-2019, 09:10 AM
  2. Colourful Message Boxes When They Return Search Results.
    By kevb8ll in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-30-2018, 12:19 PM
  3. [SOLVED] Code to search Excel and return results even if part of search text is present
    By Taoyuan00 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-30-2016, 09:20 AM
  4. Replies: 2
    Last Post: 05-14-2015, 01:30 PM
  5. [SOLVED] Search column for entered value and return results to textbox in userform
    By MIFF3436 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-11-2015, 06:35 AM
  6. Replies: 6
    Last Post: 08-22-2014, 08:47 AM
  7. [SOLVED] Userform Search to return results in columns in listbox
    By goffa in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-16-2013, 09:53 PM

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