+ Reply to Thread
Results 1 to 6 of 6

Text to columns

  1. #1
    Registered User
    Join Date
    11-17-2009
    Location
    Raleigh, NC
    MS-Off Ver
    Excel 365
    Posts
    66

    Text to columns

    Please see attachment for full example.

    I have a list of jobs where multiple tasks (Service) were completed. I need to change a row of cells that is formatted like this:

    Job | Service
    12345 | SUPP,EXT,EE

    ...and convert it to this:

    Job | Service
    12345 | SUPP
    12345 | EXT
    12345 | EE

    Thanks...
    Attached Files Attached Files
    Last edited by Figboot; 04-25-2011 at 04:55 PM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Text to columns...with a twist

    This would require VBA to do properly.

    Here's a macro for expanding rows of data to multiple rows parsing out the delimited values in one column while duplicating all the others.Just edit the Col = 3 code to Col = 4 (for column D if that is correct) and run it on a copy of your data, should do what you want. There's a sample workbook too you could drop your data into and test it out.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    11-17-2009
    Location
    Raleigh, NC
    MS-Off Ver
    Excel 365
    Posts
    66

    Re: Text to columns...with a twist

    Quick question...in the process of learning VBA here. Attached is the worksheet from the link. On the "Part 2" tab, everything works great as is with the provided data. But, in the data I need to insert, the column that will need to be "parsed" is column L as oppsed to C. What do I need to alter in the code in order to make this work correctly?

    Thanks again for the assistance.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    11-17-2009
    Location
    Raleigh, NC
    MS-Off Ver
    Excel 365
    Posts
    66

    Re: Text to columns...with a twist

    Okay...I figured out how to change the column. But now when I try to run the macro on a list of data, it will return with an error on this row of code:

    Rows(Rw + 1 & ":" & Rw + UBound(MyArr)).Insert xlShiftDown

    How can I alter this to allow for in excess of 2k rows of data?

    Thanks again.
    Last edited by Figboot; 04-25-2011 at 04:54 PM.

  5. #5
    Registered User
    Join Date
    11-17-2009
    Location
    Raleigh, NC
    MS-Off Ver
    Excel 365
    Posts
    66

    Re: Text to columns

    Okay...I think I figured it out. I had an issue with my headers. Sorry for the extra posts!

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Text to columns

    Always feels good to work out the little details, doesn't it? Good job. Glad the macro worked out for you.

+ 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