我想设置这样的边框。
我的代码无法像图片中那样执行效果,中间是空的(没有边框)具有此边框粗细。
范围为A4:B30
。
With Range(Cells(6, 1), Cells(row, 2))' row is second last row
.Borders.LineStyle = xlContinuous
.Weight = xlHairline
End With
如何在我的范围的内部细胞之间获得一个薄的中间边界?
答案 0 :(得分:2)
对于化妆品更改,请始终尝试录制宏并阅读代码。这是最好的方式。 :)
Sub testBorders()
With Range(Cells(6, 1), Cells(30, 2)).Borders(xlEdgeRight)
'/(xlEdgeRight) sets the border only to right most cells
.LineStyle = xlContinuous
.Weight = xlMedium '/ as per your pic you are looking for medium weight.
End With
End Sub