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?

マクロ 図形挿入

0
Posted at
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

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?