martinctc
6/14/2017 - 11:01 AM

Define specifications for a Chart object and apply to selected Chart

Define specifications for a Chart object and apply to selected Chart

Sub Format_a_Chart()

'r converts cm to points
r = 28.3464567


Dim shp1 As Shape
Dim i, j, k As Long

Set shp1 = ActiveWindow.Selection.ShapeRange(1)

shp1.Height = 4.4 * r
shp1.Width = 9.58 * r
shp1.Left = 12.43 * r

Set shp1 = ActiveWindow.Selection.ShapeRange(1)
i = 1
j = shp1.Chart.FullSeriesCollection.Count

For i = 1 To j
    shp1.Chart.FullSeriesCollection(i).HasDataLabels = False
Next

shp1.Chart.Axes(xlValue).AxisTitle.Font.Size = 8
shp1.Chart.Axes(xlCategory).AxisTitle.Font.Size = 8
shp1.Chart.Axes(xlValue).TickLabels.Font.Size = 8
shp1.Chart.Axes(xlCategory).TickLabels.Font.Size = 8

End Sub