+ Reply to Thread
Results 1 to 4 of 4

VBA Same last names

  1. #1
    Registered User
    Join Date
    08-08-2019
    Location
    Salt Lake City, Utah
    MS-Off Ver
    2010
    Posts
    11

    Question VBA Same last names

    I have a list of employees where some employees have the same last name. I have created a template that I can type in the employees last name and it will in another cell bring in the employee's first name. My complication is that I have a few employees with the same last name. I need a formula to stop on these and allow the user to choose the correct employee only in these cases of the same last name.

    The attachment is a file I have created. The P-Card Template tab is where I want the information to be pulled to. The Coding tab is the tab I am having complications with. I have way more employees than shown on this tab. Though you get the idea. On the P-Card Template tab. If I type in Smith in the Last Name cell. It will bring up the first Smith from the Coding tab. But if I want the second Smith. I need to create an IF /Or or macro or something to allow me to choose the correct Smith.

    Any Ideas?
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor ranman256's Avatar
    Join Date
    07-29-2012
    Location
    Kentucky
    MS-Off Ver
    Excel 2003
    Posts
    1,177

    Re: VBA Same last names

    your search would have to display all matching answers.

    case 0
    Msgbox No Results
    case 1
    'load this find
    case >1
    'show list of results, let user pick from list

  3. #3
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: VBA Same last names

    For some reason, I'm being blocked from pasting the code I wrote. I've attached the workbook instead; sorry mods.

    WBD
    Attached Files Attached Files
    Office 365 on Windows 11, looking for rep!

  4. #4
    Registered User
    Join Date
    08-08-2019
    Location
    Salt Lake City, Utah
    MS-Off Ver
    2010
    Posts
    11

    Re: VBA Same last names

    Thank you for this.

+ 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. Replies: 4
    Last Post: 08-13-2019, 03:11 PM
  2. Replies: 3
    Last Post: 03-14-2017, 01:48 PM
  3. [SOLVED] List in dynamic combobox which shows open workbook names and workshee names
    By igormigor in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-01-2016, 06:09 AM
  4. Replies: 2
    Last Post: 12-08-2015, 03:01 PM
  5. [SOLVED] I need to compare student quiz submission names/grades against a master list of names.
    By NoxExcel in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-15-2013, 08:00 PM
  6. Replies: 1
    Last Post: 05-14-2012, 10:14 AM
  7. Replies: 5
    Last Post: 01-13-2012, 03:20 PM

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