I have some code that searches for form command buttons by going through all the Shapes on a sheet, and checking their name.
This is not particularly efficient. The code looks like this:
Dim Sh As Shape
With Trades
For Each Sh In .Shapes
If Mid(Sh.Name, 2, 3) = "btn" Then
Sh.Delete
End If
Next Sh
End With
Is there a way to loop just through form command buttons?
This is not particularly efficient. The code looks like this:
Dim Sh As Shape
With Trades
For Each Sh In .Shapes
If Mid(Sh.Name, 2, 3) = "btn" Then
Sh.Delete
End If
Next Sh
End With
Is there a way to loop just through form command buttons?