Microsoft Office Tutorials and References
In Depth Information
19.3.8 BorderAround Method
Include alignment
Include border formats
Include pattern formats
Include column width and row height in the autoformat
Note that if the range is a single cell, the AutoFormat method also formats the current region
containing the cell. (The CurrentRegion property and the current region are discussed in detail
later in this section.) Put another way, the following two statements are equivalent:
19.3.8 BorderAround Method
This method adds a border to a range and optionally sets the Color, LineStyle, and Weight
properties for the border. The syntax is:
RangeObject .BorderAround( LineStyle , Weight , ColorIndex , Color )
The LineStyle parameter can be one of the following XlLineStyle constants (note that the
Excel documentation refers to a nonexistent XlBorderLineStyle enum):
Enum XlLineStyle
xlLineStyleNone = -4142
xlDouble = -4119
xlDot = -4118
xlDash = -4115
xlContinuous = 1 ' the default
xlDashDot = 4
xlDashDotDot = 5
xlSlantDashDot = 13
End Enum
The optional Weight parameter specifies the border weight and can be one of the following
XlBorderWeight constants:
Enum XlBorderWeight
xlMedium = -4138
xlHairline = 1
xlThin = 2 ' the default
xlThick = 4
End Enum
Note that the Weight property is ignored unless the LineStyle is xlContinuous or omitted.
Search JabSto ::

Custom Search