Sub ボタン作成と登録() ActiveSheet.Shapes.AddShape(msoShapeRectangle, 198, 23.25, 59.25, 24).Select Application.CommandBars("Format Object").Visible = False With Selection.ShapeRange.Fill .Visible = msoTrue .ForeColor.RGB = RGB(255, 0, 0) .Solid End With Selection.ShapeRange.Name = "botton1" Selection.Name = "botton1" Selection.ShapeRange(1).TextFrame2.TextRange.Characters.Text = "start" With Selection.ShapeRange(1).TextFrame2.TextRange.Characters(1, 5). _ ParagraphFormat .Alignment = msoAlignCenter End With ActiveSheet.Shapes.Range(Array("botton1")).Select Selection.OnAction = "連続動作" End Sub