2018年11月24日土曜日

罫線の設定

サンプルコード

    Sub 罫線の設定()
        
        ''格子を設定
        Range("A1:D5").Borders.LineStyle = xlContinuous
        
        ''罫線を消す
        Range("A1:D5").Borders.LineStyle = xlLineStyleNone
        
        ''太い外枠を設定(BorderAroundメソッド)
        Range("A1:D5").BorderAround Weight:=xlMedium
        
        ''内側の縦線に細線を設定
        Range("A1:D5").Borders(xlInsideVertical).Weight = xlThin
        
        ''内側の横線に極細線を設定
        Range("A1:D5").Borders(xlInsideHorizontal).Weight = xlHairline
        
        ''表の右外に太い縦線を設定
        Range("E1:E5").Borders(xlEdgeLeft).Weight = xlMedium
        
    End Sub

0 件のコメント:

コメントを投稿