Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2007: get formula from charttitle | Charts and Charting in Excel | |||
Excel Format Question -- CC:SS treated as time HH:mm | Excel Discussion (Misc queries) | |||
VBA: Can't set ChartTitle.Text?? | Charts and Charting in Excel | |||
Question on using time in Excel | Excel Worksheet Functions | |||
How to get a ChartTitle formula | Charts and Charting in Excel |