Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Excel/VBA question: Link ChartTitle at run-time, anyone?

Using VBA and Excel I'm trying to link the ChartTitle of an embedded chart
to a cell, but I always get an runtime error. Do anyone know how to do this?

Here is what I try to do:

.ChartObjects(name).Chart.ChartTitle.Text = "=" & .Cells(row, 1).address

(the . is a worksheet, name is the correct string and row is an nice
integer..)

K__t


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,489
Default Excel/VBA question: Link ChartTitle at run-time, anyone?

Hi,

Try this,

..ChartObjects(1).Chart.ChartTitle.Text = _
"=" & ActiveCell.Parent.Name & "!" _
& ActiveCell.Address(ReferenceStyle:=xlR1C1)


Knut Hollund wrote:

Using VBA and Excel I'm trying to link the ChartTitle of an embedded chart
to a cell, but I always get an runtime error. Do anyone know how to do this?

Here is what I try to do:

.ChartObjects(name).Chart.ChartTitle.Text = "=" & .Cells(row, 1).address

(the . is a worksheet, name is the correct string and row is an nice
integer..)

K__t



--

Cheers
Andy

http://www.andypope.info

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Excel/VBA question: Link ChartTitle at run-time, anyone?

"Andy Pope" wrote in message
...
Hi,

Try this,

.ChartObjects(1).Chart.ChartTitle.Text = _
"=" & ActiveCell.Parent.Name & "!" _
& ActiveCell.Address(ReferenceStyle:=xlR1C1)

Knut Hollund wrote:

Using VBA and Excel I'm trying to link the ChartTitle of an embedded

chart
to a cell, but I always get an runtime error. Do anyone know how to do

this?

Here is what I try to do:

.ChartObjects(name).Chart.ChartTitle.Text = "=" & .Cells(row,

1).address

(the . is a worksheet, name is the correct string and row is an nice
integer..)


Thanks, for the answer, I didn't think about the reference style. The
answer didn't solve my problem completely, but it made me test something I
had tested before (External) and then suddenly I recognized that the title
was blank.., ohh not again... As always when a bug is difficult to find, its
a trivial error! Sorry to bother you all. Here is the code that solved my
problem:

..ChartObjects(name).Chart.ChartTitle.Text = .Cells(row + 1,
1).address(External:=True, ReferenceStyle:=xlR1C1)

(note the row+1 (grrr), and bytheway no need to activate anything)

K__t


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
Excel 2007: get formula from charttitle [email protected] Charts and Charting in Excel 1 February 7th 08 06:40 PM
Excel Format Question -- CC:SS treated as time HH:mm 1clncc Excel Discussion (Misc queries) 2 June 7th 07 11:10 PM
VBA: Can't set ChartTitle.Text?? Ed Charts and Charting in Excel 1 October 3rd 06 11:59 PM
Question on using time in Excel C Tate Excel Worksheet Functions 8 July 20th 05 11:42 AM
How to get a ChartTitle formula DaH via OfficeKB.com Charts and Charting in Excel 0 June 6th 05 07:40 PM


All times are GMT +1. The time now is 10:18 AM.

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

About Us

"It's about Microsoft Excel"