Newline (char(13)) in a formula

F

Frank

Hi

I'd like to have a formula in a cel display its resultstring in multiple
lines:

e.g. if I have the following formula: ="First line of text" & Char(13) &
"Second line of text"
I would like to display it in two line in a single cell. If i do it like
above i get a small square in stead of a newline break.

How can I achieve this?

Thanks a lot!
 
J

joeu2004

Frank said:
I'd like to have a formula in a cel display its resultstring in multiple
lines:
e.g. if I have the following formula: ="First line of text" & Char(13) &
"Second line of text"

Rather than a formula, can you simply enter the following text:

First line of text<alt-Enter>Second line of text

<alt-Enter> means that you press and hold the Alt key while press the
Enter key.

Note: As always, you might need to expand the width of the cell in
order to see the two lines exactly as you intend them. Suprisingly,
Autofit does not do the job (at least not in Office Excel 2003).

You can also use alt-Enter within a string in a formula; it is the same
as concatenating char(10). For example:

=if(true, "Line one<alt-Enter>Line two")

But you will see a square box, not a new line, unless you format the
cell to Wrap Text (Format > Cells > Alignment).
 
J

joeu2004

Frank said:
I'd like to have a formula in a cel display its resultstring in multiple
lines:
e.g. if I have the following formula: ="First line of text" & Char(13) &
"Second line of text"

Rather than a formula, can you simply enter the following text:

First line of text<alt-Enter>Second line of text

<alt-Enter> means that you press and hold the Alt key while press the
Enter key.

Note: As always, you might need to expand the width of the cell in
order to see the two lines exactly as you intend them. Suprisingly,
Autofit does not do the job (at least not in Office Excel 2003).

You can also use alt-Enter within a string in a formula; it is the same
as concatenating char(10). For example:

=if(true, "Line one<alt-Enter>Line two")

But you will see a square box, not a new line, unless you format the
cell to Wrap Text (Format > Cells > Alignment).
 
F

Frank

That did it, i forgot to format as wrap text, thats why it did not work in
first time.

Thanks Bob!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top