0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

セルに罫線を引く

Last updated at Posted at 2020-08-25
Option Explicit

'外枠ノーマル線、内側細線の罫線を引く
Sub DrawCellsLineThin()
    Call DrawCellsLine(a_aroundLine:=xlThin, a_innerLine:=xlHairline)
End Sub

'外枠太線、内側ノーマル線の罫線を引く
Sub DrawCellsLineThick()
    Call DrawCellsLine(a_aroundLine:=xlMedium, a_innerLine:=xlThin)
End Sub

'セルに罫線を引く
Sub DrawCellsLine(ByVal a_aroundLine As Long, ByVal a_innerLine As Long)
    Dim targetRange As Range: Set targetRange = Selection
    With targetRange
        .Borders.LineStyle = xlContinuous
        .Borders.Weight = a_innerLine '内枠の罫線
        .BorderAround Weight:=a_aroundLine '外枠の罫線
    End With
End Sub
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?