Skip to content

Latest commit

 

History

History
54 lines (36 loc) · 1.67 KB

Excel.DataBarBorder.md

File metadata and controls

54 lines (36 loc) · 1.67 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
DataBarBorder object (Excel)
vbaxl10.chm884072
vbaxl10.chm884072
Excel.DataBarBorder
e46bb88b-ec41-a4f9-8926-34d0a22ad8e9
03/29/2019
medium

DataBarBorder object (Excel)

Represents the border of the data bars specified by a conditional formatting rule.

Remarks

Use the DataBarBorder object to get or set the color and border type for data bars. To access the DataBarBorder object associated with a data bar conditional formatting rule, use the BarBorder property. After retrieving the DataBarBorder object, use its Color property to return a FormatColor object that you can use to set the color of the data bars.

Example

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.

Range("A1:A10").Select 
Range("A1:A10").Activate 
 
Set myDataBar = Selection.FormatConditions.AddDatabar 
With myDataBar.BarBorder 
 .Type = xlDataBarBorderSolid 
 .Color.ThemeColor = xlThemeColorAccent2 
 .Color.TintAndShade = 0 
End With 

Properties

See also

[!includeSupport and feedback]