ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Populate text box for graphs (https://www.excelbanter.com/excel-discussion-misc-queries/134688-populate-text-box-graphs.html)

Greg A

Populate text box for graphs
 
I am hoping you can help. I have a several graphs that plot monthly results.
For each graph, there is a text box that contains the annual results to
date. The format of the text box is:

YTD
Objective 1000
Actual 2000

The objective results are in A1 and the actual results are in A2.

In cell B1 I wrote a formula: ="YTD"&"Objective "&A1&"actual "&A2
Then I linked B1 to the text box.

The problem is the text all comes out on one line. I have to shrink the text
box size and insert spaces to get it to the correct format. Is there an easy
way to write this formula with the correct format?


bj

Populate text box for graphs
 
the last time I did something like this, I went around the problem by using
four text boxes inside a rectangle and had no lines around the text boxes. I
other words, I couldn't make it do what I wanted.

"Greg A" wrote:

I am hoping you can help. I have a several graphs that plot monthly results.
For each graph, there is a text box that contains the annual results to
date. The format of the text box is:

YTD
Objective 1000
Actual 2000

The objective results are in A1 and the actual results are in A2.

In cell B1 I wrote a formula: ="YTD"&"Objective "&A1&"actual "&A2
Then I linked B1 to the text box.

The problem is the text all comes out on one line. I have to shrink the text
box size and insert spaces to get it to the correct format. Is there an easy
way to write this formula with the correct format?


JLatham

Populate text box for graphs
 
Try one of these three variations and see if you don't get separate lines.
I'm not at a point that I can test to see which (if any) will work.

="YTD" & CHAR(10) & "Objective "&A1 & CHAR(10) &"actual "&A2
or
="YTD" & CHAR(13) & "Objective "&A1 & CHAR(13) &"actual "&A2
or
="YTD" & CHAR(10) & CHAR(13) & "Objective "&A1 & CHAR(10) & CHAR(13)
&"actual "&A2

I think the first one should do it. Make sure your linked to cell (B1)
allows text wrapping. That way you'll be able to see what it looks like in
the cell and how it looks when it gets to the text box.

"Greg A" wrote:

I am hoping you can help. I have a several graphs that plot monthly results.
For each graph, there is a text box that contains the annual results to
date. The format of the text box is:

YTD
Objective 1000
Actual 2000

The objective results are in A1 and the actual results are in A2.

In cell B1 I wrote a formula: ="YTD"&"Objective "&A1&"actual "&A2
Then I linked B1 to the text box.

The problem is the text all comes out on one line. I have to shrink the text
box size and insert spaces to get it to the correct format. Is there an easy
way to write this formula with the correct format?



All times are GMT +1. The time now is 05:47 AM.

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