|
これでいかがでしょう?
Private Sub OptionButton1_Click()
Dim objOval As Shape
Dim x As Shape
For Each x In ActiveSheet.Shapes
If x.Name = "いいい" Then
x.Delete
End If
Next x
If objOval Is Nothing Then
ActiveSheet.Shapes.AddShape(msoShapeOval, 200, 200, 10, 10).Select
Selection.Name = "あああ"
ActiveSheet.Shapes("あああ").Fill.Visible = msoFalse
End If
Set objOval = Nothing
End Sub
Private Sub OptionButton2_Click()
Dim objOval As Shape
Dim x As Shape
For Each x In ActiveSheet.Shapes
If x.Name = "あああ" Then
x.Delete
End If
Next x
If objOval Is Nothing Then
ActiveSheet.Shapes.AddShape(msoShapeOval, 100, 100, 10, 10).Select
Selection.Name = "いいい"
ActiveSheet.Shapes("いいい").Fill.Visible = msoFalse
End If
Set objOval = Nothing
End Sub
|
|