Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
art art is offline
external usenet poster
 
Posts: 22
Default Extract the value from a cell, and add it to a chart title

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Extract the value from a cell, and add it to a chart title

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 93
Default Extract the value from a cell, and add it to a chart title

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 115
Default Extract the value from a cell, and add it to a chart title

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Chart Title from Cell in Sheet1? Mike M 91107 Charts and Charting in Excel 3 January 1st 09 01:12 PM
Using part of a cell in a chart title Nicole Charts and Charting in Excel 1 May 15th 07 09:44 AM
Chart Axis Title via cell ref. ju1eshart Charts and Charting in Excel 2 December 5th 06 02:13 PM
Can I have a value in a chart title that references a cell? dveenhuis Excel Discussion (Misc queries) 1 June 28th 06 06:22 PM
Pasting Objects into Chart title and Axis title Sam Charts and Charting in Excel 1 June 6th 05 08:50 PM


All times are GMT +1. The time now is 01:34 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"