PDA

View Full Version : Manipulating Chart Title



MrAshton
03-14-2008, 02:59 PM
How can I make the chart title = to a value in a cell or a stored value
This is the code I have: With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = [e1]
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "Category"
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Total"
End With As you can imagine, the ChartTitle object with characters.Text does not accept the [e1] method. I've tried other combinations like simply:
.ChartTitle.Formula = [e1] and
.ChartTitle.select
selection.formula = [e1] and
ChartTitle = [e1]
Nothing is accepted. Is there a way to make the title equal to the value in tha range E1?

Bob Phillips
03-14-2008, 03:09 PM
Great, another area where that nasty shortcutting falls :rotlaugh:



With ActiveChart
.HasTitle = True
.ChartTitle.Characters.text = ActiveSheet.Range("E1").Value
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.text = "Category"
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.text = "Total"
End With

MrAshton
03-14-2008, 04:16 PM
perfect! thanks!