主题
Borders (属性)
返回一个 Borders 集合,该集合在条件格式规则的计算结果为 True 时指定单元格边框的格式。只读。
说明
对于条件格式对象,您只能为单元格的上边框、下边框和侧边框设置属性。
示例
javascript
/*此示例将工作表 Sheet1 中区域 B1:B10 的第一个(Top10)条件格式的左边缘边框设置为红色细线。*/
function test() {
let top = Application.Worksheets.Item("Sheet1").Range("B1:B10").FormatConditions.Item(1)
let boder = top.Borders.Item(xlEdgeLeft)
boder.LineStyle = xlContinuous
boder.Weight = xlThin
boder.ColorIndex = 3
}
javascript
/*本示例设置活动工作表上区域 B1:B10 中第二个(Top10)条件格式边框的线条样式和粗细。*/
function test() {
let top = ActiveSheet.Range("B1:B10").FormatConditions.Item(2)
let boders = top.Borders
boders.LineStyle = xlContinuous
boders.Weight = xlThick
}