"边框项" 属性 (Excel)Borders.Item property (Excel)

返回一个**Border** 对象, 该对象代表单元格区域或样式的边框之一。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
IndexIndex 必需Required XlBordersIndexXlBordersIndex 可以是XlBordersIndex常量之一。Can be one of the XlBordersIndex constants.

示例Example

下例设置单元格区域 A1:G1 的底部边界的颜色。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)

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.