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
More than 3 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme