Include a hard return in a concatenated string
Upcoming Power Excel Seminars
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 7 of 7

Thread: Include a hard return in a concatenated string

  1. #1
    New Member
    Join Date
    Mar 2002
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    How can include a hard return in a concatenated string? i want to stack multiple cells (that make up an address in this case) in a cell formated to wrap.

  2. #2
    Guest

    Default

    try alt+enter

  3. #3
    MrExcel MVP Barrie Davidson's Avatar
    Join Date
    Feb 2002
    Location
    Winnipeg
    Posts
    2,330
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-03-08 09:09, CAYMANIAC wrote:
    How can include a hard return in a concatenated string? i want to stack multiple cells (that make up an address in this case) in a cell formated to wrap.
    If your cell is formatted to wrap, use this:

    ="Barrie"&CHAR(10)&"Davidson"

    Regards,

    Barrie Davidson

    "You're only given a little spark of madness. You mustn't lose it." - Robin Williams

  4. #4
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Austin, Texas USA
    Posts
    11,654
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    ="the cat"&CHAR(10)&"in the hat"

  5. #5
    New Member
    Join Date
    Mar 2002
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    CHAR(10) works great, couldn't get Alt+ Enter to work (I had tried that). Any idea how to avoid wrapping blank cells?

  6. #6
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Austin, Texas USA
    Posts
    11,654
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    {=A1&IF(AND(ISTEXT(A1:B1)),CHAR(10),"")&B1}

    {=A1&IF(OR(ISBLANK(A1:B1)),"",CHAR(10))&B1}

    Note: These are array formulae which must be entered using the Control+Shift+Enter key combination. The outermost braces, { }, are not entered by you -- they're supplied by Excel in recognition of a properly entered array formula.

    Or...

    =A1&IF(AND(ISTEXT(A1),ISTEXT(B1)),CHAR(10),"")&B1

    =A1&IF(OR(ISBLANK(A1),ISBLANK(B1)),"",CHAR(10))&B1


    [ This Message was edited by: Mark W. on 2002-03-08 09:54 ]

  7. #7
    New Member
    Join Date
    Mar 2002
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    Thanks

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 

 
DMCA.com