O
Otto Moehrbach
Excel XP & Win XP
I have a number of Forms buttons on a sheet. I want to delete those buttons
that have a specific caption. To do that I must first capture the caption.
The following code is a simplification of what I need. It doesn't work
because the "Caption" line is not right. How would I write the code to
capture the caption? If I can't capture the caption, I could use the
assigned macro name. How would I do that?
Thanks for your time. Otto
Sub RemoveButtons()
Dim ShapeA As Shape
For Each ShapeA In ActiveSheet.Shapes
If ShapeA.Caption = "Doodle" Then _
ShapeA.Delete
Next ShapeA
End Sub
I have a number of Forms buttons on a sheet. I want to delete those buttons
that have a specific caption. To do that I must first capture the caption.
The following code is a simplification of what I need. It doesn't work
because the "Caption" line is not right. How would I write the code to
capture the caption? If I can't capture the caption, I could use the
assigned macro name. How would I do that?
Thanks for your time. Otto
Sub RemoveButtons()
Dim ShapeA As Shape
For Each ShapeA In ActiveSheet.Shapes
If ShapeA.Caption = "Doodle" Then _
ShapeA.Delete
Next ShapeA
End Sub