April 2006
Beginner
1114 pages
98h 16m
English
Use the ErrorBars object to control the appearance of error bars on a chart. Use the Series object’s ErrorBar method to create error bars, and use the Series object’s ErrorBars property to get a reference to this object. The ErrorBars object has the following members. Key members (shown in bold) are covered in the following reference section:
Application BorderClearFormatsCreator DeleteEndStyleName Parent Select
The ErrorBars object is similar to the DropLines, HiLoLines, DownBars, and UpBars objects. As with those objects, you can select, delete, or change the appearance of error bars. However, error bars have two additional members: EndStyle and ClearFormats. The following code adds error bars to a chart and changes their appearance:
Sub ErrorBarsMembers( )
Dim chrt As Chart, sr As Series, eb As ErrorBars
' Get the chart.
Set chrt = ActiveChart
' Make it a line chart
chrt.ChartType = xlLine
' Get a series.
Set sr = chrt.SeriesCollection(1)
' Add error bars.
sr.ErrorBar xlY, xlErrorBarIncludeBoth, xlErrorBarTypeStError
' Format the error bars.
sr.ErrorBars.EndStyle = xlCap
sr.ErrorBars.Border.ColorIndex = 3
' Remove color
'sr.ErrorBars.ClearFormats
End SubRead now
Unlock full access