注册 登录
编程论坛 Excel/VBA论坛

求助 如何在excel 使用编程的方式对单元格边框标黑

神经蛙90 发布于 2019-12-24 21:55, 2122 次点击
小白刚开始接触excel编程,希望各位大神不吝赐教
1 回复
#2
rhloo2020-05-22 14:14
程序代码:

    With Range("B3:D6")
        .Borders(xlEdgeLeft).LineStyle = xlContinuous
        .Borders(xlEdgeLeft).Weight = xlThin
        .Borders(xlEdgeTop).LineStyle = xlContinuous
        .Borders(xlEdgeTop).Weight = xlThin
        .Borders(xlEdgeBottom).LineStyle = xlContinuous
        .Borders(xlEdgeBottom).Weight = xlThin
        .Borders(xlEdgeRight).LineStyle = xlContinuous
        .Borders(xlEdgeRight).Weight = xlThin
        .Borders(xlInsideVertical).LineStyle = xlContinuous
        .Borders(xlInsideVertical).Weight = xlThin
        .Borders(xlInsideHorizontal).LineStyle = xlContinuous
        .Borders(xlInsideHorizontal).Weight = xlThin
    End With

1