This documentation is archived and is not being maintained.

Databar.BarBorder Property (Excel)

Returns an object that specifies the border of a data bar. Read-only

Version Added: Excel 2010

expression .BarBorder

expression A variable that represents a Databar object.

Return Value

The following code example selects a range of cells, adds a data bar conditional formatting rule to that range, uses the BarBorder property to retrieve the DataBarBorder object associated with that rule, and then sets the data bar's color, tint, and type.

Set myDataBar = Selection.FormatConditions.AddDatabar 
With myDataBar.BarBorder 
 .Type = xlDataBarBorderSolid 
 .Color.ThemeColor = xlThemeColorAccent2 
 .Color.TintAndShade = 0 
End With