ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Inserting a CR into a text string (https://www.excelbanter.com/excel-discussion-misc-queries/126956-inserting-cr-into-text-string.html)

rtbrd

Inserting a CR into a text string
 
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?

Pete_UK

Inserting a CR into a text string
 
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

rtbrd wrote:

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?



Bernard Liengme

Inserting a CR into a text string
 
Pete' keyboard had a hiccup today; he meant to type CHAR(10)
best wishes
Bernard_Canada
www.stfx.ca/people/bliengme
remove caps from email

"rtbrd" wrote in message
...
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?




rtbrd

Inserting a CR into a text string
 
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

"Pete_UK" wrote:

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

rtbrd wrote:

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?




Dave Peterson

Inserting a CR into a text string
 
I bet Pete meant:

=A1&CHaR(10)&B1



Pete_UK wrote:

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

rtbrd wrote:

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?


--

Dave Peterson

Dave Peterson

Inserting a CR into a text string
 
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.

rtbrd wrote:

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

"Pete_UK" wrote:

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

rtbrd wrote:

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?




--

Dave Peterson

Pete_UK

Inserting a CR into a text string
 
Thanks Dave and Bernard for the correction - too much VBA at the moment
<bg

Pete

Bernard Liengme wrote:

Pete' keyboard had a hiccup today; he meant to type CHAR(10)
best wishes
Bernard_Canada
www.stfx.ca/people/bliengme
remove caps from email

"rtbrd" wrote in message
...
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?




All times are GMT +1. The time now is 04:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com