+ Reply to Thread
Results 1 to 6 of 6

An InStr Issue

  1. #1
    Registered User
    Join Date
    05-07-2009
    Location
    Ronks, PA US
    MS-Off Ver
    Excel 2003
    Posts
    10

    An InStr Issue

    I am trying to find the first and last names of people in a cell. I have a userform to get their first and last names separately. I am trying to run a VBA macro to determine if each cell in a column contains both first and last names, and then put a "Y" in an adjacent column. The Code I have is as follows:
    Please Login or Register  to view this content.
    With just one InStr statement, it finds the first name just fine, but it isn't the right person, because there is more than one person with that first name. the second InStr won't allow it to find anything. I know I'm missing something simple, and would appreciate any help you can provide.
    Last edited by bobo6429; 05-18-2009 at 04:54 PM.
    "It's all fun and games until someone loses an eye. Then it's just one big game of Find The Eye!" -M. Keefer

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: An InStr Issue

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    05-07-2009
    Location
    Ronks, PA US
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: An InStr Issue

    That would work, but the names are in no particular order, plus some might have a middle initial, and others may have suffixes like JR and Sr.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: An InStr Issue

    OK, I'll keep guessing what your data looks like:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    05-07-2009
    Location
    Ronks, PA US
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: An InStr Issue

    That worked! Thanks!

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: An InStr Issue

    You're welcome. Would you please mark the thread as Solved?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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