Excel Tipsメニューに戻る

msoShape5pointStar オートシェイプをVBAで作成

五つ星ができます。


Excel VBA コード

Sub ExMakeShape()
    Dim tshape As Shape
    
    With ActiveSheet.Range("D14:E20")
        Set tshape = ActiveSheet.Shapes.AddShape(Type:=msoShape5pointStar, _
        Left:=.Left, Top:=.Top, Width:=.Width, Height:=.Height)
        tshape.Name = "シェイプ5pointStar"
    End With
    Set tshape = Nothing
End Sub

Private Sub CommandButton2_Click()
    ExMakeShape
End Sub



Excel実行画面



■■■
このサイトの内容を利用して発生した、いかなる問題にも一切責任は負いませんのでご了承下さい
■■■
当ホームページに掲載されているあらゆる内容の無許可転載・転用を禁止します


Copyright (c) Excel-Excel ! All rights reserved