Inserting a CR into a text string

R

rtbrd

I want to concatenate two strings in a worksheet to be used in a text box in
a chart however I would like the two strings to appear on seperate lines in
the text box. Is there a way to insert a carriage return between the two
concatenated strings in the worksheet?
 
P

Pete_UK

Try this in C1, with your strings in A1 and B1:

=A1&CHR(10)&B1

In C1 use Format | Cells | Alignment (tab) and check Wrap Text to see
the effect.

Hope this helps.

Pete
 
R

rtbrd

Pete, thanks that worked but I had to use the CHAR function, CHR returned an
error. In the worksheet it still shows as one line but in the chart the two
strings appear on seperate line, exactly what I wanted.

Joe
 
D

Dave Peterson

I bet Pete meant:

=A1&CHaR(10)&B1



Pete_UK said:
Try this in C1, with your strings in A1 and B1:

=A1&CHR(10)&B1

In C1 use Format | Cells | Alignment (tab) and check Wrap Text to see
the effect.

Hope this helps.

Pete
 
D

Dave Peterson

Select the cell(s)
format|cells|alignment tab|check Wrap Text

And it'll look pretty in the cell, too.

This char(10) is the same as alt-enter if you're entering plain old text.
 
Top