+ Reply to Thread
Results 1 to 12 of 12

Split a string of data among separate cells

  1. #1
    Registered User
    Join Date
    12-11-2012
    Location
    cincinnati, ohio
    MS-Off Ver
    Excel 2010
    Posts
    43

    Split a string of data among separate cells

    Hi All,

    I have data that I need to split into individual points. My macro charts the data, as a scatter plot, with: Column A as the title of the chart, Column B as the X axis, and Columns C and D as the Y axis. What I need is for when the Product ID has more than 1 number listed to split the numbers out into their own rows and keep the columns B, C, and D the same for each row created form the original. So for row 167, I would want 3 rows (001,002,003) each with packaging, 200, and 100, in B, C, and D respectively. I am not sure where to begin. I tried to build a macro myself but, I immediately got tripped up when I tried to record a "Find" Formula to run on the data. Any help would be greatly appreciated.

    Thanks in advance.
    Sample Data.jpg
    Last edited by rodrignj; 02-15-2013 at 08:50 AM.

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Split a string of data among separate cells

    attach a sample file, no jpg, with input data and desired result
    If solved remember to mark Thread as solved

  3. #3
    Registered User
    Join Date
    12-11-2012
    Location
    cincinnati, ohio
    MS-Off Ver
    Excel 2010
    Posts
    43

    Re: Split a string of data among separate cells

    Sample Data.xlsm

    I have attached an excel workbook with a sample of my data as it exists and how I need it to exist. I would like to do this all with a macro.

    Thank you very much for your help!

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Split a string of data among separate cells

    Try this one

    Please Login or Register  to view this content.

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Split a string of data among separate cells

    Try the attached
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    12-11-2012
    Location
    cincinnati, ohio
    MS-Off Ver
    Excel 2010
    Posts
    43

    Re: Split a string of data among separate cells

    @AB33 This works perfectly, exactly what I was looking for. I have 2 questions: why does it delete my title line, can I fix that? Also, can it be made to look for "-" as well as ","? Thank you very much for your help!
    Last edited by rodrignj; 02-14-2013 at 09:53 AM. Reason: Tag user

  7. #7
    Registered User
    Join Date
    12-11-2012
    Location
    cincinnati, ohio
    MS-Off Ver
    Excel 2010
    Posts
    43

    Re: Split a string of data among separate cells

    @Jindon This is close to what I was looking for, except I wanted the "new" lines to just be added to the list, not a whole new list. Thank you for your help!
    Last edited by rodrignj; 02-14-2013 at 09:54 AM. Reason: tag user

  8. #8
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Split a string of data among separate cells

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    12-11-2012
    Location
    cincinnati, ohio
    MS-Off Ver
    Excel 2010
    Posts
    43

    Re: Split a string of data among separate cells

    @Jindon this is spot on! thanks!

    Thanks to everyone for the help!

  10. #10
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Split a string of data among separate cells

    Rod,
    Your titles were on row 2 and my code copies row 2 as well, I do not know how the heading is missing.
    On your original request, the separator was a comma. I did not see any other separator.
    Jindon has provided you with the solution. Fino!

  11. #11
    Registered User
    Join Date
    12-11-2012
    Location
    cincinnati, ohio
    MS-Off Ver
    Excel 2010
    Posts
    43

    Re: Split a string of data among separate cells

    @Jindon this is spot on! thanks!

    Thanks to everyone for the help!

  12. #12
    Registered User
    Join Date
    12-11-2012
    Location
    cincinnati, ohio
    MS-Off Ver
    Excel 2010
    Posts
    43

    Re: Split a string of data among separate cells

    @AB33, I am not clear about the title situation, as you mentioned @Jindon's solutions solved my problem there. Regarding the "-", you were absolutely right with this in your first post, I only noticed that, that existed in my data after I tested your macro. Just wanted to let you know you were right. Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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