トップページ(目次)

166.罫線_太線_を引く

<実行前後>
 → 
Sub 罫線_太線_を引く()

    With Range("B2:C3")
        .Borders(xlEdgeTop).Weight = xlThick ’上
        .Borders(xlEdgeBottom).Weight = xlThick ’下
        .Borders(xlEdgeRight).Weight = xlThick ’右
        .Borders(xlEdgeLeft).Weight = xlThick ’左
        .Borders(xlInsideVertical).Weight = xlThick '中の縦
        .Borders(xlInsideHorizontal).Weight = xlThick '中の横
    End With
    
End Sub
Weight = xlThick が太線 上・下・右・左・中の縦・中の横 と順番に線を引いているので、中の縦・中の横 を外せば外枠だけに線を引ける
Sub 罫線_太線_を引く_外枠だけ()

    With Range("B2:C3")
        .Borders(xlEdgeTop).Weight = xlThick ’上
        .Borders(xlEdgeBottom).Weight = xlThick ’下
        .Borders(xlEdgeRight).Weight = xlThick ’右
        .Borders(xlEdgeLeft).Weight = xlThick ’左
    End With
    
End Sub

Copyright © 2021 https://excel3000.web.fc2.com/ All Rights Reserved.
    inserted by FC2 system