Change all Chart Legend FONT sizes across entire spreadsheet

F

flightsim.gregory

Have file folders with dozens of spreadsheets and noticed the CHART
LEGEND fonts a too BIG. I'd like to change ALL chart legend font sizes
on all worksheets in a spreadsheet at once.. using a tool or script,
etc. Any solutions? There are simply too many charts to open and
change fonts individually.

-G
 
D

Debra Dalgleish

The following code will change the font size in all charts in the active
workbook:

'=======================
Sub ChangeLegendFont()

Dim chObj As ChartObject
Dim ws As Worksheet
Dim ch As Chart
Dim lFont As Long

lFont = 6 'set the font size

For Each ws In ThisWorkbook.Worksheets
For Each chObj In ws.ChartObjects
chObj.Chart.Legend.Font.Size = lFont
Next chObj
Next ws

For Each ch In ThisWorkbook.Charts 'chart sheets
ch.Legend.Font.Size = lFont
Next ch

End Sub
'================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top