April 2006
Beginner
1114 pages
98h 16m
English
range.Borders([Index])
Returns the collection of Border objects representing the borders of the specified range or a Border object representing a border specified by one of the following constants: xlDiagonalDown, xlDiagonalUp, xlEdgeBottom, xlEdgeLeft, xlEdgeRight, xlEdgeTop, xlInsideHorizontal, or xlInsideVertical.
The following code adds a border around the specified range:
With ActiveSheet.Range("B2:B5")
.Borders(xlEdgeBottom).LineStyle = xlContinuous
.Borders(xlEdgeLeft).LineStyle = xlContinuous
.Borders(xlEdgeRight).LineStyle = xlContinuous
.Borders(xlEdgeTop).LineStyle = xlContinuous
End WithRead now
Unlock full access