功能:
向区域添加边框,并设置新边框的 Border 对象的 Color、LineStyle 和 Weight 属性。
语法:
rng.BorderAround (LineStyle、 Weight、 ColorIndex、 Color、 ThemeColor)
rng是一个表示 Range 对象的变量。
参数:
名称 必需/可选 数据类型 说明
LineStyle 可选 Variant 指定边框线条样式 的 XlLineStyle 常量之一。
Weight 可选 XlBorderWeight 边框粗细。
ColorIndex 可选 XlColorIndex 边框颜色,作为当前调色板的索引或作为 XlColorIndex 常量。
Color 可选 Variant 边框颜色,以 RGB 值表示。
ThemeColor 可选 Variant 主题颜色,作为当前颜色主题的索引或 XlThemeColor 值。
XlLineStyle 枚举
指定边框的线条样式。
名称 值 说明
xlContinuous 1 实线。
xlDash -4115 虚线。
xlDashDot 4 点划相间线。
xlDashDotDot 5 划线后跟两个点。
xlDot -4142 点线。
xlDouble -4119 双线。
xlLineStyleNone -4118 无线。
xlSlantDashDot 13 倾斜的划线。
XlBorderWeight 枚举 (Excel)
指定某一区域周围的边框的粗细。
名称 值 说明
xlHairline 1 细线(最细的边框)。
xlMedium -4138 中。
xlThick