Sub sbAddRedRectangle()
Call sbAddRedShape(msoShapeRectangle) 'shapeType:角が丸い四角
End Sub
Sub sbAddRedeRectangularCallout()
Call sbAddRedShape(msoShapeRectangularCallout) 'shapeType:長方形の吹き出し
End Sub
Private Sub sbAddRedShape(shapeType As MsoAutoShapeType)
'MsoAutoShapeTypeはオートシェイプの形状を示す定数
'マニュアル作成作業でよく使用する赤枠・背景透明の図形を挿入する(図形の種類は引数で指定)
With ActiveCell
ActiveSheet.Shapes.AddShape _
(Type:=shapeType, _
Left:=.Left, Top:=.Top, Width:=100, Height:=50).Select
End With
Selection.ShapeRange.Fill.Visible = msoFalse
With Selection.ShapeRange.Line
.Visible = msoTrue
.ForeColor.RGB = RGB(255, 0, 0)
.Weight = 2.5 '太さ
.Transparency = 0.3 '透明度
End With
End Sub
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