Controlling legend font size

martwhit

New Member
Joined
Jun 3, 2015
Messages
4
I have a project containing numerous embedded charts across several worksheets. From time to time, I have seen that the legend font is being changed to a very small and unreadable font size (e.g. 3.4 pt instead of the 8 or 10 that I chose originally) without any obvious intervention on my part, though I suspect it might relate to very long entries from time to time. I finally decided to try to fix this problem by putting in some code to forcibly reset the legend font every time I enter new data into the worksheet, using the following syntax:

Worksheets("Sheet1").ChartObjects("Chart 1").Chart.Legend.Font.Size = 8

This code works perfectly for many of my embedded charts, but doesn't work at all for others. Given that all the charts that it works for are fairly new additions, I have a suspicion that it might have something to do with the age of a specific chart, as this is a project developed over many years, originally starting in Excel 2003. If so, does anyone know of a good way to "update" a chart without remaking it from scratch.
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.

Forum statistics

Threads
1,213,546
Messages
6,114,254
Members
448,556
Latest member
peterhess2002

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