Formula to insert alt enter into a cell

Thanks:  0
Likes:  0

# Thread: Formula to insert alt enter into a cell

1. ## 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. ## 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

3. ## 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. ## Re: Formula to insert alt enter into a cell

Originally Posted by pennysaver
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. ## 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.

6. ## Re: Formula to insert alt enter into a cell

Originally Posted by pennysaver
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. ## Re: Formula to insert alt enter into a cell

Nope, Chr is a VBA function - CHAR is the worksheet function equivalent.

8. ## 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. ## Re: Formula to insert alt enter into a cell

Originally Posted by Kevincwk2000
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:

10. ## Re: Formula to insert alt enter into a cell

Originally Posted by Antonio Toledo
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

## User Tag List

#### Posting Permissions

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