Inserting a CR into a text string

G

Guest

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
 
G

Guest

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.
 

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