+ Reply to Thread
Results 1 to 14 of 14

Merge Row into One Cell with Line Break

  1. #1
    Registered User
    Join Date
    05-30-2004
    Posts
    63

    Merge Row into One Cell with Line Break

    I have a row of data. I want to merge it all into the first cell and have a line break between each line (from each of the cells).

    Any idea how I can do this?

    Appreciate the help,

    JH

  2. #2
    Registered User
    Join Date
    11-21-2008
    Location
    Kent
    Posts
    55

    Re: Merge Row into One Cell with Line Break

    Like this?

    =CONCATENATE(A2," ",B2," ",C2)

  3. #3
    Registered User
    Join Date
    05-30-2004
    Posts
    63

    Re: Merge Row into One Cell with Line Break

    It does join them but it doesn't add a line break between each entry it has joined.

    Can that be done?

  4. #4
    Registered User
    Join Date
    06-28-2007
    Posts
    69

    Re: Merge Row into One Cell with Line Break

    Try this...


    A2&CHAR(13)&B2&CHAR(13)&C2

  5. #5
    Registered User
    Join Date
    05-30-2004
    Posts
    63

    Re: Merge Row into One Cell with Line Break

    Quote Originally Posted by mpquin View Post
    Try this...


    A2&CHAR(13)&B2&CHAR(13)&C2

    No, that doesn't make a line break either.


    Any more ideas?

    JH

  6. #6
    Registered User
    Join Date
    11-21-2008
    Location
    Kent
    Posts
    55

    Re: Merge Row into One Cell with Line Break

    =CONCATENATE(A2,CHAR(13),B2,CHAR(13),C2,CHAR(13))

    or

    =CONCATENATE(A2,CHAR(10),B2,CHAR(10),C2,CHAR(10))

    Maybe?

  7. #7
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Merge Row into One Cell with Line Break

    The above should work but the cell needs to be formatted with "Wrap Text" also.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  8. #8
    Registered User
    Join Date
    11-21-2008
    Location
    Kent
    Posts
    55

    Re: Merge Row into One Cell with Line Break

    =CONCATENATE(B1,CHAR(10),C1,CHAR(10),D1,CHAR(10),E1,CHAR(10))

    Then Format Cell - Wrap Text

    Thanks

  9. #9
    Registered User
    Join Date
    05-30-2004
    Posts
    63

    Re: Merge Row into One Cell with Line Break

    It will wrap the text but it will wrap it according to how wide the cell is.

    I need every bit of data from one of its previous cells on its own line (a line break) as if hitting the enter key.

  10. #10
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Merge Row into One Cell with Line Break

    then just drag out the column to make it wider
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  11. #11
    Registered User
    Join Date
    05-30-2004
    Posts
    63

    Re: Merge Row into One Cell with Line Break

    Quote Originally Posted by martindwilson View Post
    then just drag out the column to make it wider
    I need it on separate lines. Not on one line. Each line has to be separated according to the cells they were in before.

    Cell1 ------ Cell2 -------- Cell3

    When joined together become:

    Cell1 Cell2 Cell3

    But I need it broken into lines like this:
    Cell1
    Cell2
    Cell3

    all in the same cell.

    JH

  12. #12
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,375

    Re: Merge Row into One Cell with Line Break

    The posts above contain the solution.

    You need to make the column as wide as the widest single line text. The cell must be set to Wrap text, so the line break CHAR(13) can do its job. But if some of your text in one line is too wide for the cell, it will wrap the text to fit the cell. Thus you have to make the column as wide as the widest single line text.

  13. #13
    Registered User
    Join Date
    05-30-2004
    Posts
    63

    Re: Merge Row into One Cell with Line Break

    O, I just realized that it works in Windows Excel but not in the Mac version of MS Excel.

    Any suggestions?

    JH

  14. #14
    Registered User
    Join Date
    11-21-2008
    Location
    Kent
    Posts
    55

    Re: Merge Row into One Cell with Line Break

    Dont use a Mac LOL, erm can you do it on windows then send to your mac? But as far as I am aware it should work exactly the same on your Mac.

+ 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