Share via


LineStyle Property

Returns or sets the border line style for the specified range. Can be one of the LineStyleEnum constants; returns Null if the borders do not all have the same style. Use the IsNull function to determine whether the return value is Null. Read/write Variant.

expression.LineStyle

*expression   * Required. An expression that returns one of the objects in the Applies To list.

Remarks

You cannot set this property for a ChBorder object that represents a chart element.

Example

This example puts a green dash-dot border around each cell in the range A1:E5.

Sub SetBorder()

   Dim rngCurrent
   Dim ssConstants

   Set ssConstants = Spreadsheet1.Constants

   Set rngCurrent = Spreadsheet1.Range("a1:e5")

   rngCurrent.Borders.LineStyle = ssConstants.ssConstants.xlDashDot

   rngCurrent.Borders.Color = "Green"

End Sub

Applies to | Border Object | Borders Collection Object

See Also | Line Property