If I insert an "X" Axis label to a graph, the macro recorder gives me:
ActiveChart.ChartArea.Select
ActiveChart.SetElement (msoElementPrimaryCategoryAxisTitleAdjacentToAxis)
ActiveChart.Axes(xlCategory, xlPrimary).AxisTitle.Text = "X Axis Title"
Selection.Format.TextFrame2.TextRange.Characters.Text = "X Axis Title"
With Selection.Format.TextFrame2.TextRange.Characters(1, 12).ParagraphFormat
.TextDirection = msoTextDirectionLeftToRight
.Alignment = msoAlignCenter
End With
That's great, but the "X" Axis label is called "TextFrame2".
How can I rename this?
I foresee running into problems referencing items on a graph usinf names like this
ActiveChart.ChartArea.Select
ActiveChart.SetElement (msoElementPrimaryCategoryAxisTitleAdjacentToAxis)
ActiveChart.Axes(xlCategory, xlPrimary).AxisTitle.Text = "X Axis Title"
Selection.Format.TextFrame2.TextRange.Characters.Text = "X Axis Title"
With Selection.Format.TextFrame2.TextRange.Characters(1, 12).ParagraphFormat
.TextDirection = msoTextDirectionLeftToRight
.Alignment = msoAlignCenter
End With
That's great, but the "X" Axis label is called "TextFrame2".
How can I rename this?
I foresee running into problems referencing items on a graph usinf names like this