LineStyle Property

Applies To

Border Object, Borders Collection.

Description

Returns or sets the line style of the border. Read-write.

For Range object borders, this property can have one of the following values: xlContinuous, xlDash, xlDot, xlDouble, xlNone.

For drawing object borders, this property can have one of the following values: xlAutomatic, xlContinuous, xlDash, xlDashDot, xlDashDotDot, xlDot, xlGray25, xlGray50, xlGray75, xlNone.

Example

This example sets the line style of oval one on Sheet1 to 50 percent gray.


Worksheets("Sheet1").Ovals(1).Border.LineStyle = xlGray50

This example creates a rectangle on Sheet1 and then gives the rectangle a dashed border.


Set myRect = Worksheets("Sheet1").Rectangles.Add(Left:=72, _
            Top:=72, Width:=144, Height:=36)
myRect.Border.LineStyle = xlDash