martinctc
10/27/2017 - 4:39 PM

Tweak Labels for Scatterplots in PowerPoint

Tweak Labels for Scatterplots in PowerPoint

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
                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
                    Next
                Next
                                
            End If
			
			 'If shp.HasChart Then
             '   shp.Chart.HasAxis(xlValue) = False
             '   shp.Chart.HasAxis(xlCategory) = False
             'End If
    Next shp
    Next sld

End Sub