Skip to content

Latest commit

 

History

History
45 lines (28 loc) · 936 Bytes

Excel.Range.Borders.md

File metadata and controls

45 lines (28 loc) · 936 Bytes
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Range.Borders property (Excel)
vbaxl10.chm144089
vbaxl10.chm144089
Excel.Range.Borders
6d313fed-a8f0-94ba-e239-813685cd1d58
05/10/2019
medium

Range.Borders property (Excel)

Returns a Borders collection that represents the borders of a style or a range of cells (including a range defined as part of a conditional format).

Syntax

expression.Borders

expression A variable that represents a Range object.

Example

This example sets the color of the bottom border of cell B2 on Sheet1 to a thin red border.

Sub SetRangeBorder() 
 
 With Worksheets("Sheet1").Range("B2").Borders(xlEdgeBottom) 
 .LineStyle = xlContinuous 
 .Weight = xlThin 
 .ColorIndex = 3 
 End With 
 
End Sub

[!includeSupport and feedback]