Newline (char(13)) in a formula

  • Thread starter Thread starter Frank
  • Start date Start date
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!
 
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).
 
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).
 
That did it, i forgot to format as wrap text, thats why it did not work in
first time.

Thanks Bob!
 
Back
Top