+ Reply to Thread
Results 1 to 5 of 5

Need to re-order & delete characters in an Excel cell

  1. #1
    Registered User
    Join Date
    08-02-2012
    Location
    Vancouver, BC
    MS-Off Ver
    Excel 2010
    Posts
    1

    Angry Need to re-order & delete characters in an Excel cell

    An example of a value in an Excel cell is 100-020701000000. I need to reorder the value to be 70100-020-00-000. 70100 represents the 8-12 characters of the original value. 020 represents the 5-7 characters. 00 represents the 2-3 characters. 000 represents the 14-16 characters. Characters 1, 4 and 13 need to be deleted. Does anyone have any macro suggestions?

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Need to re-order & delete characters in an Excel cell

    Hopefully, i got this right lol, test it and make sure please. if you cant adjust the references yourself, give me a shout and i will try again

    =MID(A1,8,5)&"-"&MID(A1,5,3)&"-"&MID(A1,2,2)&"-"&MID(A1,14,3)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Need to re-order & delete characters in an Excel cell

    Why bother with a macro when standard string slicing functions will do. i.e.
    =MID(A1,8,5)&"-"&MID(A1,5,3)&"-"&MID(A1,2,2)&"-"&MID(A1,14,3)
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Need to re-order & delete characters in an Excel cell

    hmmm sounds like an echoe there Richard lol

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Need to re-order & delete characters in an Excel cell

    Quote Originally Posted by FDibbins View Post
    hmmm sounds like an echoe there Richard lol
    Indeed.. indeed indeed indeed indeed

+ 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