Selection function, first hint graphics in a circle, traverse instead of the same circle, the center of a circle coordinate access to Excel, and number of circular,
Vba implementation, thanks
CodePudding user response:
Please refer to:Option Explicit
Sub SelectAllSameOval ()
Sheet1. Activate
If LCase $(TypeName (Application. Selection)) & lt;> "Oval" Then
MsgBox "please select try again after a circle!"
The Exit Sub
End the If
Dim Shp As Shape, iW As Single, iH the As Single, iNum As Integer
IW=Selection. Width
IH=Selection. Height
INum=1
For Each Shp In Sheet1. Shapes
With Shp
If the AutoShapeType=msoShapeOval Then
. If the Width=iW And Height=iH Then
"Start number
. TextFrame. Characters. The Text=CStr (iNum) & amp; "#", "
INum=iNum + 1
End the If
End the If
End With
Next
End Sub
'
.