+ Reply to Thread
Results 1 to 6 of 6

Excel 2007 : adding newlines to concatenated text

  1. #1
    Registered User
    Join Date
    10-10-2003
    Posts
    31

    adding newlines to concatenated text

    I am concatenating text elements that together generate a very long string. I'd like to insert newlines in the formula to 'break' the text to a new line or paragraph at various points. Is there a code element I can insert in the concat formula to do this? Seems like VBA would be overkill for this.

    Thanks for your help. - Jim

  2. #2
    Valued Forum Contributor
    Join Date
    03-16-2012
    Location
    Aarhus, Denmark
    MS-Off Ver
    Excel 2007
    Posts
    992

    Re: adding newlines to concatenated text

    I'm not sure this what you are looking for, but CHAR(10) adds a line-break in a text string. If for example you put the following in a cell and format it with "Wrap Text":

    ="My first string"&CHAR(10)&"My second string" then in the cell it will show as:

    My first string
    My second string
    Last edited by Søren Larsen; 05-22-2012 at 11:26 AM. Reason: Elaboration
    Sincerely
    S?ren Larsen

    "Give a man a fish, and you'll feed him for a day. Give a man a fishing rod, and he'll steal your yacht!"

  3. #3
    Registered User
    Join Date
    10-10-2003
    Posts
    31

    Re: adding newlines to concatenated text

    Thanks Søren, that's what I needed. Could I trouble you for the CHAR( ) code for a tab? ...for that matter, where can I find the list of CHAR codes that Excel 7 recognizes? - Jim

  4. #4
    Valued Forum Contributor
    Join Date
    03-16-2012
    Location
    Aarhus, Denmark
    MS-Off Ver
    Excel 2007
    Posts
    992

    Re: adding newlines to concatenated text

    Here's a list of =CHAR() codes:

    http://www.petefreitag.com/cheatsheets/ascii-codes/

    You will see that TAB is =CHAR(9), but for some reason it won't work. Did a quick google, and it seems that using a TAB in a string of text inside a cell is not possible.

  5. #5
    Registered User
    Join Date
    10-10-2003
    Posts
    31

    Re: adding newlines to concatenated text

    Thanks again! - Jim

  6. #6
    Valued Forum Contributor
    Join Date
    03-16-2012
    Location
    Aarhus, Denmark
    MS-Off Ver
    Excel 2007
    Posts
    992

    Re: adding newlines to concatenated text

    You're welcome!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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