求大神解答
功能,首先提示選取圖形中一圓形,遍歷與其相同的圓,將圓心坐標獲取到Excel中,并對圓形編號。
vba實作,跪謝
uj5u.com熱心網友回復:
請參考:Option Explicit
Sub SelectAllSameOval()
Sheet1.Activate
If LCase$(TypeName(Application.Selection)) <> "oval" Then
MsgBox "請選中一個圓后再試!"
Exit Sub
End If
Dim Shp As Shape, iW As Single, iH As Single, iNum As Integer
iW = Selection.Width
iH = Selection.Height
iNum = 1
For Each Shp In Sheet1.Shapes
With Shp
If .AutoShapeType = msoShapeOval Then
If .Width = iW And .Height = iH Then
''開始編號
.TextFrame.Characters.Text = CStr(iNum) & "#"
iNum = iNum + 1
End If
End If
End With
Next
End Sub
'
.
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/60923.html
標籤:VBA
