Change Font Size in All PowerPoint Charts with VBA
Question details
The user needs to change chart text or data-label font sizes throughout a PowerPoint presentation using VBA.

- Product
- Microsoft PowerPoint
- Device & OS
- not provided
- Scenario
- A presentation contains charts across multiple slides, and the user wants to apply a consistent font size.
- Observed behavior
- The desired result is a consistent font size for chart elements and, where needed, separately added text boxes.
Open the presentation in a desktop version of PowerPoint that supports VBA, and save it as a macro-enabled PowerPoint Presentation (.pptm) if you want to retain the macro. Check whether the text to update is part of a chart or a separate slide text box.
Run a VBA macro to resize chart-area text and data labels
Use this macro to process top-level charts on every slide and set their chart-area and series data-label font sizes.
Chart-area formatting may not override every individually formatted chart element. The macro skips unsupported chart properties without stopping, so inspect the results after it runs.
In PowerPoint, open the presentation and select Developer > Visual Basic. If the Developer tab is hidden, enable it in PowerPoint's ribbon settings.
In the VBA editor, select Insert > Module and paste this code: Sub SetChartFonts() Dim slideObj As Slide Dim shapeObj As Shape Dim seriesIndex As Long Dim seriesCount As Long Const fontSize As Single = 12 For Each slideObj In ActivePresentation.Slides For Each shapeObj In slideObj.Shapes If shapeObj.HasChart Then On Error Resume Next shapeObj.Chart.ChartArea.Format.TextFrame2.TextRange.Font.Size = fontSize seriesCount = 0 seriesCount = shapeObj.Chart.SeriesCollection.Count For seriesIndex = 1 To seriesCount If shapeObj.Chart.SeriesCollection(seriesIndex).HasDataLabels Then shapeObj.Chart.SeriesCollection(seriesIndex).DataLabels.Format.TextFrame2.TextRange.Font.Size = fontSize End If Next seriesIndex On Error GoTo 0 End If Next shapeObj Next slideObj End Sub
Change the value of fontSize in the module if needed. Place the cursor inside SetChartFonts and select Run > Run Sub/UserForm.
Return to the slides and check chart text and data labels. If an element remains unchanged, select it in the chart and use Home > Font Size to adjust it, or adapt the macro to target that element.
Resize separate slide text boxes with a second macro
Use this option when the text is in standalone slide text boxes rather than in the chart itself.
Edit presentations with WPS Office
WPS Office is a free, lightweight alternative with a familiar interface for opening and editing PowerPoint presentations. Its format compatibility makes it easy to move existing files into your workflow; it does not fix PowerPoint's VBA behavior.

Frequently Asked Questions
Why did the chart-area macro run without changing the text?
Chart-area formatting may not override individually formatted elements. Select the unchanged title, label, or legend in the chart and adjust it through Home > Font Size, or modify the VBA to target that element directly.
How can I change the font size used by the macro?
Open Developer > Visual Basic and change the number in Const fontSize As Single = 12 to the size you want, then run the macro again.
Will the chart macro also resize text boxes placed on a slide?
No. Standalone slide text boxes are separate shapes. Use the text-box macro if you want to resize all top-level text boxes, including those unrelated to charts.
How do I keep the macro in the presentation?
Use File > Save As and choose PowerPoint Macro-Enabled Presentation (.pptm). A standard .pptx file does not retain VBA macros.




