Name
series
.ErrorBar(Direction
, Include
, Type
, [Amount
], [MinusValues
])
Synopsis
For 2-D chart types, adds error bars to the series. Causes an error for 3-D chart types.
Argument |
Settings |
---|---|
|
An |
|
An |
|
An |
|
If |
|
If |
The following code adds error bars to the first series of the active chart:
Sub AddErrorBars( ) Dim chrt As Chart, sr As Series ' Get a chart. Set chrt = ActiveChart ' Use 2-D chart type. chrt.ChartType = xlLineMarkers ' Get first series Set sr = chrt.SeriesCollection(1) ' Add error bars. sr.ErrorBar xlY, xlErrorBarIncludeBoth, xlErrorBarTypeStError End Sub
Get Programming Excel with VBA and .NET now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.