I am working on a macro for formatting charts. I got stuck at choosing a number of decimals (0 or 1) for data labels and y-axis -> if the chart line is "flat" (low volatility) I want to see one decimal point. I've tried to base the calculations on variance, average etc. but nothing seems to work at all.
'$'
' --- DECIMALS DISPLAYED --- 'mn/mx - minimum/maximum in dataseries kustomFormat = IIf(Abs(mn) / (Abs(mx) + 0.0001) > 0.6, "0.0", "0") ActiveChart.Axes(xlValue).TickLabels.NumberFormat = kustomFormat On Error Resume Next For i = 1 To ActiveChart.SeriesCollection.Count ActiveChart.FullSeriesCollection(i).DataLabels.NumberFormat = kustomFormat Next i
'$'