+ Reply to Thread
Results 1 to 7 of 7

How to convert First, Middle, Last name to Last, First Middle Initial with VBA

  1. #1
    Registered User
    Join Date
    07-29-2013
    Location
    Indianapolis, IN
    MS-Off Ver
    Excel 2010
    Posts
    3

    How to convert First, Middle, Last name to Last, First Middle Initial with VBA

    Hello,

    I have been working on a macro to export data to another system. The other system will only read names as Last name, First name Middle Initial. Currently names are displayed in a cell as John E. Smith. I need to covert this (in the same cell) to display Smith, John E.

    I have searched the forums and have not found exactly what I needed. Thanks for any help!

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: How to convert First, Middle, Last name to Last, First Middle Initial with VBA

    Please attach a sample workbook with enough data to make it clear what is needed. 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 demonstrated, mock them up manually if needed. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

    Note: Please don't attach documents containing confidential data like (address, telephone, ID#s, etc.).


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: How to convert First, Middle, Last name to Last, First Middle Initial with VBA

    Moderator's Note:

    Will be moving thread to vba/programming subforum. thanks.
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

  4. #4
    Registered User
    Join Date
    07-29-2013
    Location
    Indianapolis, IN
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: How to convert First, Middle, Last name to Last, First Middle Initial with VBA

    Hi,

    I have attached two spreadsheets named, Before and After. I have also attached the macro I have been working on if that helps.

    To give you a little more information on my project….

    In column A, teams are divided up into 3 groups: PS, NB and MKT. I only need this macro to convert the name for MKT, which I highlighted in both spreadsheets. When I import the data from column B (INDIV ID#), it needs to pull the file and attach itself to these records. I have the other teams working except MKT. The external system that I’m importing the data too will only search based on a Last Name, First Name Middle Initial format (if they have a middle initial). Hopefully this makes sense.

    Thanks for any help. The end users are really giving me challenges!!
    Attached Files Attached Files

  5. #5
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: How to convert First, Middle, Last name to Last, First Middle Initial with VBA

    Hi lwine

    This Code will work on your sample file...it won't cover all the possible anomalies in the real world. But you can modify as required.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  6. #6
    Registered User
    Join Date
    07-29-2013
    Location
    Indianapolis, IN
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: How to convert First, Middle, Last name to Last, First Middle Initial with VBA

    Thanks jaslake!

    I'll apply it to my project right away and make the necessary modifications.

  7. #7
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: How to convert First, Middle, Last name to Last, First Middle Initial with VBA

    You're welcome...glad I could help.

    If this resolves your issue please mark your Thread as SOLVED.

    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:
    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ 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. Extracting the Middle Initial/Middle Name
    By akwishestofish in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-16-2012, 11:13 AM
  2. Replies: 3
    Last Post: 03-09-2012, 03:19 PM
  3. Separate Middle Initial From First Name
    By Charles in forum Excel General
    Replies: 9
    Last Post: 03-09-2006, 05:15 AM
  4. Remove middle initial from "first name middle initial"
    By Justin F. in forum Excel General
    Replies: 15
    Last Post: 09-26-2005, 02:05 PM
  5. [SOLVED] First name, Middle Initial
    By wnfisba in forum Excel General
    Replies: 2
    Last Post: 09-21-2005, 10:05 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