+ Reply to Thread
Results 1 to 5 of 5

Moving last word in text string

  1. #1
    Registered User
    Join Date
    06-10-2010
    Location
    New York
    MS-Off Ver
    Excel 2003
    Posts
    3

    Moving last word in text string

    I would like to move the last word in a text string in a singe cell to the cell on its right (for all cells in the colunm). The text list could be:

    James Brown T-3250
    Jackie Chan Hero T-3200
    Mary T-3333


    In this list I want the last word (i.e. the T-something) cut and pasted to the column on the right, leaving the rest of the words intact.

    Thanks.


    Solved: Stanley's code was very clean and nice. Thanks all.
    Last edited by jothecat; 06-14-2010 at 12:46 AM.

  2. #2
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Moving last word in text string

    Try this

    Assuming your data is in Column A begining in A1
    in C1
    Please Login or Register  to view this content.
    In D1
    Please Login or Register  to view this content.

    Drag/Fill down

    Copy C:D

    PasteSpecial > values in A1

    Delete C:D


    Hope this helps.

    If you need any further information, please feel free to ask further

    However

    If this takes care of your needs, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED. It helps everybody!
    Also
    If you are satisfied by any members response to your problem please consider using the scales icon top right of thier post to show your appreciation.
    Last edited by Marcol; 06-13-2010 at 09:45 PM. Reason: just noticed typos

  3. #3
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Moving last word in text string

    maybe..
    Please Login or Register  to view this content.
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  4. #4
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Moving last word in text string

    Or

    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Moving last word in text string

    jothecat,

    I am assuming that your data begins in cell A1.


    Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).

    Adding the Macro
    1. Copy the below macro, by highlighting the macro code and pressing the keys CTRL + C
    2. Open your workbook
    3. Press the keys ALT + F11 to open the Visual Basic Editor
    4. Press the keys ALT + I to activate the Insert menu
    5. Press M to insert a Standard Module
    6. Paste the code by pressing the keys CTRL + V
    7. Press the keys ALT + Q to exit the Editor, and return to Excel
    8. To run the macro from Excel, open the workbook, and press ALT + F8 to display the Run Macro Dialog. Double Click the macro's name to Run it.


    Please Login or Register  to view this content.

    Then run the "SplitColA" macro.
    Have a great day,
    Stan

    Windows 10, Excel 2007, on a PC.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

+ 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