Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
H
I'm trying to take the value from a cell on a different worksheet, and add it to some text for a chart title I presently have Dim BarnName as Strin BarnName = ActiveChart.ChartTitle = "=data!R6c1 ActiveChart.ChartTitle.Characters.Text = BarnNam I know the second line isn't correct, but I'm not sure how to write it TI Art |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The macro should look like this
Sub Assign_Chart_Title( ActiveChart.ChartTitle.Characters.Text = Worksheets("data").Range("A7").Valu End Su To use the macro, select the chart, and run the macro Regards Edwin Ta http://www.vonixx.co ----- Art wrote: ---- H I'm trying to take the value from a cell on a different worksheet, and add it to some text for a chart title I presently have Dim BarnName as Strin BarnName = ActiveChart.ChartTitle = "=data!R6c1 ActiveChart.ChartTitle.Characters.Text = BarnNam I know the second line isn't correct, but I'm not sure how to write it TI Art |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Art,
Try BarnName = ActiveChart.ChartTitle.Text & " " & _ sheets("Data").cells(6, 1).value ActiveChart.ChartTitle.Text = BarnName Cecil "Art" wrote in message ... Hi I'm trying to take the value from a cell on a different worksheet, and add it to some text for a chart title. I presently have: Dim BarnName as String BarnName = ActiveChart.ChartTitle = "=data!R6c1" ActiveChart.ChartTitle.Characters.Text = BarnName I know the second line isn't correct, but I'm not sure how to write it. TIA Art |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you want this to be dynamic, put the formula with the added text into
a cell, and link the title to the cell. C1 has text, C2 has a value, put this into C3: =C1&TEXT(C2,"0.00") Use some appropriate number format, or you may get something unexpected. Now select the chart title, press the = key, and select C3 with the mouse. To link the title to the cell in VBA, use: ActiveChart.ChartTitle.Text = _ "=" Sheets("Data").Cells(3,3).AddressR1C1(External:=Tr ue) You need to specify this address in RC notation, and External:=True includes the qualified sheet name. - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services Tutorials and Custom Solutions http://PeltierTech.com/ _______ Cecilkumara Fernando wrote: Art, Try BarnName = ActiveChart.ChartTitle.Text & " " & _ sheets("Data").cells(6, 1).value ActiveChart.ChartTitle.Text = BarnName Cecil "Art" wrote in message ... Hi I'm trying to take the value from a cell on a different worksheet, and add it to some text for a chart title. I presently have: Dim BarnName as String BarnName = ActiveChart.ChartTitle = "=data!R6c1" ActiveChart.ChartTitle.Characters.Text = BarnName I know the second line isn't correct, but I'm not sure how to write it. TIA Art |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Chart Title from Cell in Sheet1? | Charts and Charting in Excel | |||
Using part of a cell in a chart title | Charts and Charting in Excel | |||
Chart Axis Title via cell ref. | Charts and Charting in Excel | |||
Can I have a value in a chart title that references a cell? | Excel Discussion (Misc queries) | |||
Pasting Objects into Chart title and Axis title | Charts and Charting in Excel |