martinctc
10/27/2017 - 4:39 PM

Tweak Labels for Scatterplots in PowerPoint

[Tweak Labels for Scatterplots in PowerPoint] #PowerPoint VBA

Sub ScatterLabelsTweak()

Dim sld As Slide
Dim shp As Shape
Dim sr As Series
Dim chrt As Chart
Dim i, j, k, m As Long

    For Each sld In ActivePresentation.Slides
        For Each shp In sld.Shapes
            If shp.HasChart Then
                'shp.Chart.HasAxis(xlValue) = False 'Turn off axis
                'shp.Chart.HasAxis(xlCategory) = False 'Turn off axis
                'shp.Chart.Axes(xlValue).TickLabels.Font.Size = 8 'Axis Labels
                'shp.Chart.Axes(xlCategory).TickLabels.Font.Size = 8 'Axis Labels
                'shp.Chart.Axes(xlValue).AxisTitle.Font.Size = 12 'Axis Title
                'shp.Chart.Axes(xlCategory).AxisTitle.Font.Size = 12 'Axis Title
                With shp.Chart.Axes(xlValue) 'Y-axis
                    .MinimumScale = 2
                    .MaximumScale = 7.5
                End With
                With shp.Chart.Axes(xlCategory) 'X-axis
                    .MinimumScale = 0
                    .MaximumScale = 1
                End With
                shp.Chart.HasLegend = False
                
                j = shp.Chart.FullSeriesCollection.Count
                Debug.Print j
                For i = 1 To j
                    k = shp.Chart.SeriesCollection(i).Points.Count
                    Debug.Print k
                    For m = 1 To k
                        shp.Chart.SeriesCollection(i).Points(m).DataLabel.Font.Size = 8
                        shp.Chart.SeriesCollection(i).Points(m).DataLabel.Font.Name = "Arial"
                    Next
                Next
            End If
    Next shp
    Next sld

End Sub