Borders.Item Property (Excel)

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

Syntax

expression .Item(Index)

expression A variable that represents a Borders object.

Parameters

Name

Required/Optional

Data Type

Description

Index

Required

XlBordersIndex

One of the constants of XlBordersIndex.

Remarks

XlBordersIndex can be one of these XlBordersIndex constants.

xlDiagonalDown

xlDiagonalUp

xlEdgeBottom

xlEdgeLeft

xlEdgeRight

xlEdgeTop

xlInsideHorizontal

xlInsideVertical

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)

See Also

Concepts

Borders Collection

Borders Object Members