Item Property (Borders Collection)

Applies To

Borders collection object.

Description

Returns a Border object that represents one of the borders of either a range of cells or a style. Read-only.

Syntax

expression.Item(Index)

expression Required. An expression that returns a Borders collection.

Index Required Long. The border to return. Can be one of the following XlBorderType constants: xlInsideHorizontal, xlInsideVertical, xlDiagonalDown, xlDiagonalUp, xlEdgeBottom, xlEdgeLeft, xlEdgeRight, or xlEdgeTop.

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)