ET 开发人员参考 |
Range.BorderAround 方法 |
语法
表达式.BorderAround(LineStyle, Weight, ColorIndex, Color, ThemeColor)
表达式 一个代表 Range 对象的变量。
参数
名称 | 必选/可选 | 数据类型 | 说明 |
---|---|---|---|
LineStyle | 可选 | Variant | 指定边框线型的 XlLineStyle 常量之一。 |
Weight | 可选 | XlBorderWeight | 边框粗细。 |
ColorIndex | 可选 | XlColorIndex | 边框颜色,作为当前调色板的索引或作为 XlColorIndex 常量。 |
Color | 可选 | Variant | 边框颜色,以 RGB 值表示。 |
ThemeColor | 可选 | Variant | 主题颜色,作为当前颜色主题的索引,或作为 XlThemeColor 值。 |
返回值
Variant
说明
必须只指定以下一项:ColorIndex、Color 或 ThemeColor。
可指定 LineStyle 或 Weight,但不能同时指定这两者。如果未指定任何参数,ET 将使用默认的线条样式和粗细。
本方法只绘制了整个区域的外框,而不填充该区域。如果要设置所有单元格的边框,就必须设置 Borders 集合的 Color 、LineStyle 和 Weight 属性。要清除边框,必须将区域中所有单元格的 LineStyle 属性设置为 xlLineStyleNone。
示例
本示例在 Sheet1 的区域 A1:D4 周围添加红色粗边框。
示例代码 |
---|
|