Borders Property

Returns a Borders collection that represents all the borders for the specified range.

Syntax

object.Borders(CellBorders).LineStyle [=LineStyle]

object.Borders(CellBorders).Color [=Value]

Applies To

Range Object

Parameters

The CellBorders has the following values:

Constant Value Description
Around 0 Outside borders.
Left 1 Border at the left-hand edge of the range.
Top 2 Border at the top of the range.
Right 3 Border at the right-hand edge of the range.
Bottom 4 Border at the bottom of the range.
DiagonalUp 5 Border running from the lower left-hand corner to the upper right of each cell in the range.
DiagonalDown 6 Border running from the upper left-hand corner to the lower right of each cell in the range.
Inside 7 Inside borders.
InsideVertical 8 Horizontal borders for all cells in the range except borders on the outside of the range.
InsideHorizontal 9 Vertical borders for all the cells in the range except borders on the outside of the range.


The LineStyle has the following values:

Constant Value Description
None 0 The line style of a border is none (no border visible).
Thin 1 The line style of a border is thin, wdith 1 pixel.
Thick 2 The line style of a border is thick, width 2 pixels.
Dot 3 The line style of a border is dotted.