Microsoft Office Tutorials and References
In Depth Information
Figure 19-20. The xlDiagonalDown constant
The Borders property of the Range object returns a Borders collection for the range. This
collection contains several Border objects, indexed by the following constants:
Enum XlBordersIndex
xlDiagonalDown = 5
xlDiagonalUp = 6
xlEdgeLeft = 7
xlEdgeTop = 8
xlEdgeBottom = 9
xlEdgeRight = 10
xlInsideVertical = 11
xlInsideHorizontal = 12
End Enum
(The Excel help documentation refers to these as XlBorderType constants.)
To illustrate, the following code sets the interior color of the range shown in Figure 19-19 t o a
gray scale and sets the bottom border to thick red (shown as black in the figure). Note the use of
nested With statements:
With Range("a1:b4, d2:e2")
.Interior.Color = RGB(196, 196, 196)
With .Borders(xlEdgeBottom)
.Weight = xlThick
.Color = RGB(255, 0, 0)
End With
End With
Figure 19-20 shows the results of changing the constant xlEdgeBottom to xlDiagonalDown ,
while Figure 19-21 shows the results of changing the constant to xlInsideVertical .
Figure 19-20. The xlDiagonalDown constant
Figure 19-21. The xlInsideVertical constant
 
 
 
Search JabSto ::




Custom Search