+ Reply to Thread
Results 1 to 12 of 12

Parsing Data Strings into Columns

  1. #1
    Forum Contributor GuruWannaB's Avatar
    Join Date
    01-24-2008
    Location
    An hour due East of Cowtown Ohio
    MS-Off Ver
    2010
    Posts
    421

    Parsing Data Strings into Columns

    I have a spreadsheet that gathers information from multiple cells and strings the data into a long string - each piece of data broken by a comma in the string.

    In another spreadsheet, I copy this data string into column A on sheet 1 - starting on row 2 and down.

    On sheet 2 - and this is where I need help - I would like to have a macro that will take each data string on Sheet 1 column A and parse it out into multiple columns but the same row on Sheet 2.

    ColumnA Row2 Sheet1 -> changing to many columns on Sheet2 but still on the same row.

    The data string always represents the same number of data components - its just a matter of breaking it out and placing each data piece into its own column.

    Thanks in advance.
    Last edited by GuruWannaB; 05-04-2009 at 04:50 PM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Parsing Data Strings into Columns

    Hello GuruWannaB,

    If you have a workbook you can post, it will make answering your questions faster and easier.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Contributor GuruWannaB's Avatar
    Join Date
    01-24-2008
    Location
    An hour due East of Cowtown Ohio
    MS-Off Ver
    2010
    Posts
    421

    Re: Parsing Data Strings into Columns

    Here's a generic example of the data strings.....

    Hope that helps - thanks again
    Attached Files Attached Files

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Parsing Data Strings into Columns

    Hello GuruWannaB,

    I take it the data will start in row 1 of Sheet1. Do you want to format the date a specific way or just use the system default?

  5. #5
    Forum Contributor GuruWannaB's Avatar
    Join Date
    01-24-2008
    Location
    An hour due East of Cowtown Ohio
    MS-Off Ver
    2010
    Posts
    421

    Re: Parsing Data Strings into Columns

    Actually...for convenient sake...I start the data on row 2...that way when it is parsed out, it will also be on row 2. The date is ok either way...its manipulated elsewhere.

  6. #6
    Forum Contributor
    Join Date
    04-01-2009
    Location
    Irvine, CA
    MS-Off Ver
    Excel 2010
    Posts
    280

    Re: Parsing Data Strings into Columns

    Data --> Text to Columns will do what you want.
    If you want a macro (VBA code) to do it, then just record a macro of Text to Columns and change the ranges for variables.

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Parsing Data Strings into Columns

    Please Login or Register  to view this content.
    Last edited by shg; 05-04-2009 at 04:48 PM.
    Entia non sunt multiplicanda sine necessitate

  8. #8
    Forum Contributor GuruWannaB's Avatar
    Join Date
    01-24-2008
    Location
    An hour due East of Cowtown Ohio
    MS-Off Ver
    2010
    Posts
    421

    Re: Parsing Data Strings into Columns

    SHG

    This works great...however I am losing two columns of data somewhere. When I run the macro...it works, but only goes to column AV when I've got enough data to go over to column AX.

    Chance2,

    You taught me something new...but I am looking for a macro that I can bastardize abit - thanks however. I might rethink my processes to work with this newfound knowledge as a backup however.

  9. #9
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Parsing Data Strings into Columns

    Oops. Try again.

  10. #10
    Forum Contributor GuruWannaB's Avatar
    Join Date
    01-24-2008
    Location
    An hour due East of Cowtown Ohio
    MS-Off Ver
    2010
    Posts
    421

    Re: Parsing Data Strings into Columns

    Bloody Brilliant!

    Thank you so much!

    Now take the rest of the day off!!! PAID

  11. #11
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Parsing Data Strings into Columns

    Hello GuruWannaB,

    This will convert Sheet1's data into separate columns on Sheet2.
    Please Login or Register  to view this content.

  12. #12
    Forum Contributor GuruWannaB's Avatar
    Join Date
    01-24-2008
    Location
    An hour due East of Cowtown Ohio
    MS-Off Ver
    2010
    Posts
    421

    Re: Parsing Data Strings into Columns

    Thank you Leith...this gives me something more to work with...!

+ 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