Error Bars Object Example

Sub AddAndFormatErrorBars() Dim oSer As Series Dim oErrBars As ErrorBars

'Add error bars to the first series (at +/- 10% of the value) Set oSer = ActiveSheet.ChartObjects("Chart 1").Chart.SeriesCollection(1) oSer.ErrorBar xlY, xlErrorBarIncludeBoth, xlErrorBarTypePercent, 10 'Get the ErrorBars object

Set oErrBars = oSer.ErrorBars

'Format the error bars

With oErrBars

.Border.Weight = xlThick

.Border.LineStyle =

xlContinuous

.Border.Colorlndex =

= 7

.EndStyle = xlCap

End With

End Sub

0 0

Post a comment