Edit

Share via


ErrorBar method (Excel Graph)

Applies error bars to the specified series. Variant.

Syntax

expression.ErrorBar (Direction, Include, Type, Amount, MinusValues)

expression Required. An expression that returns one of the objects in the Applies To list.

Parameters

Name Required/Optional Data type Description
Direction Required XlErrorBarDirection The error bar direction. Can be one of these XlErrorBarDirection constants: xlX (can only be used with scatter charts) or xlY (default).
Include Required XlErrorBarInclude The error bar parts to be included. Can be one of these XlErrorBarInclude constants: xlErrorBarIncludeBoth (default), xlErrorBarIncludeMinusValues, xlErrorBarIncludeNone, or xlErrorBarIncludePlusValues.
Type Required XlErrorBarType The error bar type. Can be one of these XlErrorBarType constants: xlErrorBarTypeCustom, xlErrorBarTypeFixedValue, xlErrorBarTypePercent, xlErrorBarTypeStDev, or xlErrorBarTypeStError.
Amount Optional Variant The error amount. Used for only the positive error amount when Type is xlErrorBarTypeCustom.
MinusValues Optional Variant The negative error amount when Type is xlErrorBarTypeCustom.

Example

This example applies standard error bars in the Y direction for series one. The error bars are applied in the positive and negative directions. The example should be run on a 2D line chart.

myChart.SeriesCollection(1).ErrorBar _ 
 Direction:=xlY, Include:=xlErrorBarIncludeBoth, _ 
 Type:=xlErrorBarTypeStError

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.