Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Formula to insert alt enter into a cell

This is a discussion on Formula to insert alt enter into a cell within the Excel Questions forums, part of the Question Forums category; How can a formula perform the equivalent of the keyboard alt enter in a cell? ie Make =A1&A2 where A1 ...

  1. #1
    New Member
    Join Date
    Jan 2008
    Posts
    2

    Default Formula to insert alt enter into a cell

    How can a formula perform the equivalent of the keyboard alt enter in a cell?
    ie Make =A1&A2 where A1 and A2 are cells containing text become
    a1text
    a2text
    in the new cell.

  2. #2
    MrExcel MVP
    Moderator
    Smitty's Avatar
    Join Date
    May 2003
    Location
    Crested Butte, CO
    Posts
    27,241

    Default Re: Formula to insert alt enter into a cell

    Welcome to the Board!

    You can use CHAR(10):

    =A1&CHAR(10)&A2

    Just make sure that Word Wrap is on and the row is set tall enough to see the wrap.

    Hope that helps,

    Smitty
    Smitty

    Every once in a while, there's a sudden gust of gravity...

    Check out my new book at the Mr. Excel Bookstore!

    Mr. Excel HTML Maker - Post a shot of your sheet

  3. #3
    Board Regular
    Join Date
    Jan 2008
    Location
    Sweden
    Posts
    159

    Default Re: Formula to insert alt enter into a cell

    I'm interested in something similar, I want to have a cell where I store strings of information that are separated by CHAR(10). Is there any simple way to then extract the strings and put them into several cells?
    Kind of doing the reverse of what CATraveler asked for.

    Also I find it annoying when Excel automatically makes the cell taller when using the CHAR(10). How do I prevent this? (Basically the cell I want is purely for information storage, and to extract this info on demand in another worksheet).

  4. #4
    New Member
    Join Date
    Jan 2008
    Posts
    2

    Default Re: Formula to insert alt enter into a cell

    Quote Originally Posted by pennysaver View Post
    Welcome to the Board!

    You can use CHAR(10):

    =A1&CHAR(10)&A2

    Just make sure that Word Wrap is on and the row is set tall enough to see the wrap.

    Hope that helps,

    Smitty
    Thank you very much. That is exactly what I needed.

  5. #5
    Board Regular Norie's Avatar
    Join Date
    Apr 2004
    Location
    Stirling
    Posts
    66,048

    Default Re: Formula to insert alt enter into a cell

    Antonio

    If the resizing of the cell is a problem why not use another delimiter, like a comma.
    If posting code please use code tags.

  6. #6
    New Member
    Join Date
    Mar 2008
    Posts
    12

    Default Re: Formula to insert alt enter into a cell

    Quote Originally Posted by pennysaver View Post
    Welcome to the Board!

    You can use CHAR(10):

    =A1&CHAR(10)&A2

    Just make sure that Word Wrap is on and the row is set tall enough to see the wrap.

    Hope that helps,

    Smitty
    I think there was a typo - I believe it should be CHR(10) and not CHAR(10).

  7. #7
    Board Regular Norie's Avatar
    Join Date
    Apr 2004
    Location
    Stirling
    Posts
    66,048

    Default Re: Formula to insert alt enter into a cell

    Nope, Chr is a VBA function - CHAR is the worksheet function equivalent.
    If posting code please use code tags.

  8. #8
    Board Regular
    Join Date
    Mar 2008
    Posts
    80

    Default Re: Formula to insert alt enter into a cell

    Dear Sir,

    I have similiar questions on how to make use of Macro to insert alt-enter into a cell with comma count per line, saying 5

    is

    C1,C2,C3,C4,C5,C6,C7
    C8,C9,C10,C11

    want to change the cell(s) as

    C1,C2,C3,C4,C5,
    C6,C7,C8,C9,C10,
    C11

    thanks,
    Kevin

  9. #9
    MrExcel MVP
    Moderator
    Peter_SSs's Avatar
    Join Date
    May 2005
    Location
    Macksville, Australia
    Posts
    26,284

    Default Re: Formula to insert alt enter into a cell

    Quote Originally Posted by Kevincwk2000 View Post
    Dear Sir,

    I have similiar questions on how to make use of Macro to insert alt-enter into a cell with comma count per line, saying 5

    is

    C1,C2,C3,C4,C5,C6,C7
    C8,C9,C10,C11

    want to change the cell(s) as

    C1,C2,C3,C4,C5,
    C6,C7,C8,C9,C10,
    C11

    thanks,
    Kevin
    But this (quite rightly) has now been asked in a new thread:
    Insert alt enter into a cell or a column with defined comma counted
    Hope this helps, good luck.
    Peter

    - Read: Posting Guidelines, Forum Rules & FAQs
    - Want to post a small screen shot? Try one of these Excel jeanie, MrExcel HTML Maker or Borders-Copy-Paste (To test: Test Here)
    - If posting vba code, please use Code Tags - like this [code]Paste code here[/code] - or use the VBHTML Maker

  10. #10
    MrExcel MVP
    Moderator
    Peter_SSs's Avatar
    Join Date
    May 2005
    Location
    Macksville, Australia
    Posts
    26,284

    Default Re: Formula to insert alt enter into a cell

    Quote Originally Posted by Antonio Toledo View Post
    I'm interested in something similar, I want to have a cell where I store strings of information that are separated by CHAR(10). Is there any simple way to then extract the strings and put them into several cells?
    Kind of doing the reverse of what CATraveler asked for.

    Also I find it annoying when Excel automatically makes the cell taller when using the CHAR(10). How do I prevent this? (Basically the cell I want is purely for information storage, and to extract this info on demand in another worksheet).
    Try this:

    1. Select the column by clicking its heading label.

    2. Data|Text to Columns...|Delimited|Next|Click in the "Other:" box|Hold the ALT key down and on the number keypad type 0010|Next|If you want to keep the original data then change the cell reference in the "Destination:" box to a vacant cell to the right|Finish

    For your second question, try selecting the column then
    Format|Cells...|Alignment tab|remove the check from "Wrap text"|OK
    Hope this helps, good luck.
    Peter

    - Read: Posting Guidelines, Forum Rules & FAQs
    - Want to post a small screen shot? Try one of these Excel jeanie, MrExcel HTML Maker or Borders-Copy-Paste (To test: Test Here)
    - If posting vba code, please use Code Tags - like this [code]Paste code here[/code] - or use the VBHTML Maker

Page 1 of 2 12 LastLast

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