Edit

Borders.Item property (Excel)

Returns a Border object that represents one of the borders of a range of cells, a style, or a conditional format.

Syntax

expression.Item (Index)

expression A variable that represents a Borders object.

Parameters

Name Required/Optional Data type Description
Index Required XlBordersIndex The border to return. The supported values depend on the object that returned the Borders collection. See the Remarks section.

Remarks

The supported value of Index depends on the object that returned the Borders collection:

Example

This following example sets the color of the bottom border of cells A1:G1.

Worksheets("Sheet1").Range("a1:g1"). _ 
 Borders.Item(xlEdgeBottom).Color = RGB(255, 0, 0)

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.