Skip to main content

Borders.Item property

Table of contents
  1. Syntax
  2. Parameters
  3. Example

Returns a Border object that represents one of the borders of either a range of cells or a style.

Syntax

expression.Item (Index)

expression A variable that represents a Borders object.

Parameters

Name Required/Optional Data type Description
Index Required XlBordersIndex Can be one of the XlBordersIndex constants.

Example

This following example sets the color of the bottom border of cells A1:G1.

Worksheets("Sheet1").Range("A1:G1").Borders.item(xlEdgeBottom).Color = RGB(255, 0, 0)

Leave a comment

Your email address will not be published. Required fields are marked *

Format your code: <pre><code class="language-vba">place your code here</code></pre>