+ Reply to Thread
Results 1 to 12 of 12

VB Code to split Name into First and Last Name

  1. #1
    Forum Contributor
    Join Date
    01-31-2012
    Location
    Georgia
    MS-Off Ver
    Excel 2010
    Posts
    193

    VB Code to split Name into First and Last Name

    Hello:

    Please refer to attached file.

    Have Employee name in Column A as LastName,FirstName Initial

    I need to split out as First Name and Last Name and i know this can be
    done by Text to Column feature in Excel, however my need is in VB code.

    SO here I need (As Shown)
    First Name in Column B
    Last Name in Column C
    Full Name in Column D (First Name Space LastName)


    Let me know if you have any questions.
    Thanks.

    R
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: VB Code to split Name into First and Last Name

    With text to column, and seperate on comma.

    After that

    E2 =C2&" "&D2

    See the attached file.
    Attached Files Attached Files
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Forum Contributor
    Join Date
    01-31-2012
    Location
    Georgia
    MS-Off Ver
    Excel 2010
    Posts
    193

    Re: VB Code to split Name into First and Last Name

    Hello:

    As mentioned , I know this can be done with Text to column but I need VB Code to do this task as it will part of other VB Code.

    Thanks

    R

  4. #4
    Forum Contributor
    Join Date
    01-31-2012
    Location
    Georgia
    MS-Off Ver
    Excel 2010
    Posts
    193

    Re: VB Code to split Name into First and Last Name

    Hello:

    Can any one help with this , I need VB Code

    R

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,086

    Re: VB Code to split Name into First and Last Name

    Maybe this:

    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  6. #6
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,496

    Re: VB Code to split Name into First and Last Name

    Please Login or Register  to view this content.
    Experience trumps academics every day of the week and twice on Sunday.

  7. #7
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,401

    Re: VB Code to split Name into First and Last Name

    Here is another macro that you can consider...
    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    01-31-2012
    Location
    Georgia
    MS-Off Ver
    Excel 2010
    Posts
    193

    Re: VB Code to split Name into First and Last Name

    Hello Guys:

    Thanks to all, I have already implemented "TMS" Code.

    R

  9. #9
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,401

    Re: VB Code to split Name into First and Last Name

    That is why you are supposed to mark your thread SOLVED once you have a solution you are happy with... that we other volunteers won't come along and waste time working out a solution for a question you no longer have.

  10. #10
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,086

    Re: VB Code to split Name into First and Last Name

    @R: how come there was not the usual feedback, rep and marking of the thread as Solved? Not like you!

  11. #11
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,401

    Re: VB Code to split Name into First and Last Name

    @TMS... are you directing your last comment to me???

  12. #12
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,086

    Re: VB Code to split Name into First and Last Name

    @Rick: no, to rmomim … he signs himself as "R". For some reason, I never saw post #8 but that wasn’t the usual thread closure.

+ 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. VB Code to split out Last Name, First Name
    By rmomin in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-25-2022, 02:13 AM
  2. [SOLVED] Split before Zip Code
    By nordicdust in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 07-20-2020, 06:54 AM
  3. [SOLVED] Code to split
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-16-2016, 12:16 PM
  4. [SOLVED] VB Code to split data
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-30-2016, 11:07 AM
  5. need vba code to split rows to closed wb shets depends company code met with sht name
    By julielara in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-18-2016, 12:44 PM
  6. Need Macro code to split data split in 7 sheets based on variable rows in column A
    By Alija_21 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-31-2015, 08:03 AM
  7. how to convert excel split code to word split code
    By gsrikanth in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-02-2012, 07:56 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