如何设置这个范围边界?

我想要设置这样的边框。

我想达到什么

我的代码无法执行如图所示的效果,中间是空的(没有边框)与此边框厚度。

范围是A4:B30

 With Range(Cells(6, 1), Cells(row, 2))' row is second last row .Borders.LineStyle = xlContinuous .Weight = xlHairline End With 

我怎样才能得到我的范围内的细胞之间的一个薄的中间边界?

对于美观的改变,总是尝试录制macros并阅读代码。 这是最好的方法。 🙂

 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