Macro for resizing graph text

chemist1

New Member
Joined
Aug 24, 2011
Messages
4
I'm trying to create a macro that will change all the text on a graph (legend, x and y axes scales and axis titles) to size 14 and put the legend overlapping the chart. The macro I have recorded is below, but it gets stuck at the 7th line

Any ideas why or how to fix this? Any help greatly appreciated.

Code:
    ActiveChart.Legend.Select
    ActiveChart.Legend.IncludeInLayout = False
    Selection.Format.TextFrame2.TextRange.Font.Size = 14
    ActiveChart.Axes(xlValue).AxisTitle.Select
    Selection.Format.TextFrame2.TextRange.Font.Size = 14
    ActiveChart.Axes(xlValue).Select
    Selection.Format.TextFrame2.TextRange.Font.Size = 14
    ActiveChart.Axes(xlCategory).Select
    Selection.Format.TextFrame2.TextRange.Font.Size = 14
    ActiveChart.Axes(xlCategory).AxisTitle.Select
    Selection.Format.TextFrame2.TextRange.Font.Size = 14
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
You can format all of a chart's text in one command:

ActiveChart.ChartArea.Font.Size = 14
 
Upvote 0

Forum statistics

Threads
1,224,545
Messages
6,179,432
Members
452,915
Latest member
hannnahheileen

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top