Syntax

expression.Borders

expression A variable that represents a FormatCondition object.

Example

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

Visual Basic for Applications
Sub SetRangeBorder() With Worksheets("Sheet1").Range("B2").Borders(xlEdgeBottom) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = 3 End With End Sub

See also: