+ Reply to Thread
Results 1 to 8 of 8

Split long string to multiple cells

  1. #1
    Registered User
    Join Date
    12-05-2015
    Location
    4222
    MS-Off Ver
    2016
    Posts
    7

    Split long string to multiple cells

    Can someone please tell me how I can separate the long string below into 7 separate columns?
    The string below is in cell D4. I need "Total" in D5, $14,214.00 in D6, 0.00 in D7, 0.00 in D8, -$14.95 in D9, -$661.97 in D10, $13,537.08 in D11.
    Each of the numbers could be larger or smaller from month to month, meaning $13,537.08 could become $7,897.00 and 0.00 could become 110.00

    Total $14,214.00 0.00 0.00 -$14.95 -$661.97 $13,537.08

    Thank you!

  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,939

    Re: Split long string to multiple cells

    Hi, welcome to the forum

    Have you tried the TextToColumns function under trhe Data tab?
    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
    Registered User
    Join Date
    12-05-2015
    Location
    4222
    MS-Off Ver
    2016
    Posts
    7

    Re: Split long string to multiple cells

    HA! That was easy! Thanks so much!

  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,939

    Re: Split long string to multiple cells

    you'r welcome. If this answered your question, please take a moment to mark the thread as "solved" - it helps keep things neat and tidy lol, and consider adding the reputation to those that helped (see points 2 & 3 below my 1st post to you)

  5. #5
    Registered User
    Join Date
    12-05-2015
    Location
    4222
    MS-Off Ver
    2016
    Posts
    7

    Re: Split long string to multiple cells

    This did help separate the string in my example as a one off, but what I'm really looking for is the ability to paste a string into D4 each month and have cells D5 thru D11 automatically populate as I mentioned in my original example. This will help me do calculations automatically.

  6. #6
    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,939

    Re: Split long string to multiple cells

    I had a feeling you would come back and ask that lol

  7. #7
    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,939

    Re: Split long string to multiple cells

    I got this formula from 1 of the other senior members (some time back) and modified it for your use...

    D
    4
    Total $14,214.00 0.00 0.00 -$14.95 -$661.97 $13,537.08
    5
    Total
    6
    $14,214.00
    7
    0.00
    8
    0.00
    9
    -$14.95
    10
    -$661.97
    11
    $13,537.08

    D5=TRIM(MID(SUBSTITUTE($D$4," ",REPT(" ",LEN(D$4))),LEN($D$4)*(ROW()-5)+1,LEN($D$4)))
    copied down

  8. #8
    Registered User
    Join Date
    12-05-2015
    Location
    4222
    MS-Off Ver
    2016
    Posts
    7

    Re: Split long string to multiple cells

    Perfect! Thank you!

+ 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. [SOLVED] Unable to split one long text into several cells
    By devawad in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-20-2013, 03:35 AM
  2. [SOLVED] How to split this long string code in multiple line to avoid an error???
    By tuongtu3 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-24-2013, 10:08 PM
  3. [SOLVED] Split a long table to multiple tables
    By amasson in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-02-2013, 05:37 AM
  4. [SOLVED] split string into multiple cells
    By sp1dey in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-22-2012, 02:03 PM
  5. Split cells long text with Max 40 character to multiple row using Macro
    By chee1012 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-31-2012, 10:10 AM
  6. Split a long text in a userform textbox to multiple rows on a worksheet
    By newbi004 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-31-2012, 09:03 AM
  7. Can excels Split() function split a string up at multiple spots?
    By 111StepsAhead in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-14-2011, 02:36 PM
  8. Replies: 2
    Last Post: 03-07-2006, 04:46 PM

Tags for this Thread

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