Border.LineStyle property (Excel)

Returns or sets the line style for the border. Read/write XlLineStyle, xlGray25, xlGray50, xlGray75, or xlAutomatic.

Syntax

expression.LineStyle

expression A variable that represents a Border object.

Remarks

xlDouble and xlSlantDashDot don't apply to charts.

Important

Note that the visual properties of a Border object are interlocked; that is, changing one property can induce changes in another. In most cases, the induced changes serve to make the border visible (which may or may not be desirable). However, other (more unexpected) results are possible. For an example, see the Border object.

Example

This example puts a border around the chart area and the plot area of Chart1.

With Charts("Chart1") 
 .ChartArea.Border.LineStyle = xlDashDot 
 With .PlotArea.Border 
 .LineStyle = xlDashDotDot 
 .Weight = xlThick 
 End With 
End With

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.