+ Reply to Thread
Results 1 to 2 of 2

swap values in a single cell

  1. #1
    Registered User
    Join Date
    03-08-2005
    Posts
    1

    swap values in a single cell

    I have a list of 600 cells in a format "Firstname Lastname" and i need a macro to chance these cells into "Lastname, Firstname". (with the comma)

    I've tried modifying a find/replace macro i have but im not too good at macro'ing and hence my plead for help!

    Would be nice to have it change the cell then go down a cell and do the same thing and loop for 800 odd cells but this isnt too important.

    please help!

  2. #2
    Forum Contributor
    Join Date
    01-11-2004
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    388
    Hi!

    If you literally have Firstname Lastname separated by a space and with no middle names or initials, try using the in-built methods:

    The names are in Column A. Select the column of names and go to the menu: Data > Text to columns. Choose Space as separator and when you Finish the wizard you should have Firstname in column A and Lastname in Column B.
    In C1 put = B1 & "," & A1 and copy this down your 800 rows.
    Highlight this column. Copy it (ctrl + C) and then Paste Special - values only right where it stands.

    Now delete columns A and B.

    Alf

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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