Borders Property

Applies To

FormatCondition object, Range object, Style object.

Description

Returns a Borders collection that represents the four borders of a style or a range of cells (including a range defined as part of a conditional format). Read-only.

Example

This example sets the color of the bottom border of cell B2 on Sheet1 to red.

With Worksheets("Sheet1").Range("B2").Borders(xlBottom)
    .LineStyle = xlBorderLineStyleContinuous
    .Weight = xlThin
    .ColorIndex = 3
End With