How to do a line break in a text formula

T

TJCacher

I have a cell with alignment set to "Wrap Text". If I just enter tex
into this cell, and press Alt-Enter on my keyboard, I can enter
carriage return into the cell that results in a line split:

This is sample[alt-enter]
text

What I want to do is make a text *formula* which will include a lin
split in it. I've tried using the Char() function in my text formula
but Excel shows the characters themselves, instead of acting on them.


Here is an example of a formula I've tried:

="This is sample" & char(15) & char(11) & "text"

I've tried all three combinations of carriage return, linefeed an
carriage return/linefeed combinations, but the formula doesn't resul
in a split line.

Does anyone know if it's possible to do what I'm trying to do?

Thanks for any help.

PL
 
F

Frank Kabel

Hi
try
="This is sample" & CHAR(10) & "text"
anf format the resulting cell with word wrap ('Format - Cell -
alignment)
 
D

Dana DeLouis

What I want to do is make a text *formula* which will include a line
split in it.

Just another way:

[A1] = "This is line 1" & vbLf & "Line 2"

--
Dana DeLouis
Using Windows XP & Office XP
= = = = = = = = = = = = = = = = =


TJCacher > said:
I have a cell with alignment set to "Wrap Text". If I just enter text
into this cell, and press Alt-Enter on my keyboard, I can enter a
carriage return into the cell that results in a line split:

This is sample[alt-enter]
text

What I want to do is make a text *formula* which will include a line
split in it. I've tried using the Char() function in my text formula,
but Excel shows the characters themselves, instead of acting on them.


Here is an example of a formula I've tried:

="This is sample" & char(15) & char(11) & "text"

I've tried all three combinations of carriage return, linefeed and
carriage return/linefeed combinations, but the formula doesn't result
in a split line.
 

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