Name

range.BorderAround([LineStyle], [Weight], [ColorIndex], [Color])

Synopsis

Adds a border around the specified range of cells.

Argument

Settings

LineStyle

The line style of the border. The default value is xlContinuous, which uses a continuous line. You can also explicitly specify the line style using one of the following constants: xlDash, xlDashDot, xlDashDotDot, xlDot, xlDouble, xlLineStyleNone, xlSlantDashDot, xlLineStyleNone.

Weight

The thickness of the border line. The default value is xlThin, which uses a thin line. You can also explicitly specify the weight style using one of the following constants: xlHairline, xlMedium, xlThick.

ColorIndex

The border color, as an index of the color in the current color palette or as one of the following constants: xlColorIndexAutomatic (default) and xlColorIndexNone.

Color

The border color as an RGB value.

Get Programming Excel with VBA and .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.