Closed Thread
Results 1 to 12 of 12

How to split the lines in a cell into multiple rows.

  1. #1
    Registered User
    Join Date
    11-26-2007
    Posts
    9

    How to split the lines in a cell into multiple rows.

    I have a merged cell which contains a text with multiple lines.
    I want to split the lines into multiple rows.Each line should come in a different row.
    I want to do this using macro.Is there is anyway to do this?
    There is an option to split the cell into multiple cells on the basis of the delimiter, but there is no option to split them into rows.

  2. #2
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    Are the multiple lines due to just word wrap, or are there manual carriage returns (Alt+Enter) after each line?

    Jason

  3. #3
    Registered User
    Join Date
    11-26-2007
    Posts
    9
    They are just Word wrap

  4. #4
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    Assuming they are word wrapped in one column, but multiple rows, the following procedure should accomplish what you are requesting. It will unmerge the cells that are selected, and separate them into different rows.
    Please Login or Register  to view this content.
    HTH

    Jason

  5. #5
    Registered User
    Join Date
    11-26-2007
    Posts
    9
    Thaks for the help.
    I want to split the cell into multiple rows.
    Like If the cell "A1" Contains the following text
    "I have a merged cell which contains a text with multiple lines and
    I want to split the lines into multiple rows.Each line should come in a different row."
    It should be split into two different rows "A1" and "A2" , such that in a cell only one row will be displayed.

  6. #6
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    So it is not a merged cell, but a single cell that you want to split into multiple rows, based on the number of word-wrapped rows in the one cell? If that's the case, I'm not really sure how to do that. Sorry.

  7. #7
    Registered User
    Join Date
    08-21-2012
    Location
    Jeddah
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: How to split the lines in a cell into multiple rows.

    Try this,
    A1=Original Data

    [A2]
    =LEFT(A1,LOOKUP(9.999E+307,FIND(" ",A1,ROW($A1:$A60))))

    [A3]
    =TRIM(SUBSTITUTE(A1,A2,""))
    Last edited by tariqbablu; 08-22-2012 at 05:29 PM. Reason: A1= Original Data

  8. #8
    Registered User
    Join Date
    09-24-2013
    Location
    Chennai
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: How to split the lines in a cell into multiple rows.

    Hi,

    any solution for this issue.

    I too have the same problem, I have a single cell which has wrapped data of many lines. Can i place each line in that cell in next row?

    Thanks in Advance.

  9. #9
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: How to split the lines in a cell into multiple rows.

    surya,

    Unfortunately you need to post your question in a new thread, it's against the forum rules to post a question in the thread of another user. If you create your own thread, any advice will be tailored to your situation so you should include a description of what you've done and are trying to do. Also, if you feel that this thread is particularly relevant to what you are trying to do, you can surely include a link to it in your new thread.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  10. #10
    Registered User
    Join Date
    05-05-2014
    Location
    Chennai
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: How to split the lines in a cell into multiple rows.

    Sub Unmerge()
    With Selection
    .MergeCells = False
    .WrapText = False
    .Justify
    End With
    End Sub

    the above macro only separate 252 characters, however i have required to separate more than 252 characters in one cell.

  11. #11
    Registered User
    Join Date
    05-05-2014
    Location
    Chennai
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: How to split the lines in a cell into multiple rows.

    Sub Unmerge()
    With Selection
    .MergeCells = False
    .WrapText = False
    .Justify
    End With
    End Sub

    the above macro only separate 252 characters, however i have required to separate more than 252 characters in one cell.

  12. #12
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: How to split the lines in a cell into multiple rows.

    Pls read post#9.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

Closed 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