RawlinsCross
Active Member
- Joined
- Sep 9, 2016
- Messages
- 437
Having a bit of trouble doing basic chart property adjustment. I'm wondering whether it has to do with the chart type itself? From all my searching, the syntax seems correct?
VBA Code:
Set myChart = ActiveSheet.Shapes.AddChart2(366, xlHistogram).Chart
With myChart
.SeriesCollection.NewSeries
'Histograph can't take array input??
.FullSeriesCollection(1).Values = wSht.Range("J1").CurrentRegion
.FullSeriesCollection(1).ApplyDataLabels
.HasTitle = False
.Axes(xlCategory).MajorTickMark = xlOutside
.Axes(xlCategory).TickLabels.NumberFormat = "0.0" 'This fails
.Axes(xlCategory).TickLabels.Font.Size = 10 ' This fails
.Axes(xlCategory).TickLabels.Font.Color = vbBlack 'This fails
.Axes(xlValue).MajorTickMark = xlOutside
.Axes(xlValue).TickLabels.Size = 10 'This fails
.Axes(xlValue).TickLabels.Font.Color = vbBlack 'This fails
End With