![如何在 Excel 中使用鼠标选择某个区域内的所有 ActiveX 对象?](https://linux22.com/image/1384319/%E5%A6%82%E4%BD%95%E5%9C%A8%20Excel%20%E4%B8%AD%E4%BD%BF%E7%94%A8%E9%BC%A0%E6%A0%87%E9%80%89%E6%8B%A9%E6%9F%90%E4%B8%AA%E5%8C%BA%E5%9F%9F%E5%86%85%E7%9A%84%E6%89%80%E6%9C%89%20ActiveX%20%E5%AF%B9%E8%B1%A1%EF%BC%9F.png)
答案1
考虑:
Sub ShapePicker()
Dim sh As Shape, st As Variant, Llist As String
Dim ty As String
Dim nm As String
Dim r As Range
Dim ary As Variant
For Each sh In ActiveSheet.Shapes
ty = sh.Type
nm = sh.name
Set r = sh.TopLeftCell
If ty = msoOLEControlObject Then
If Not Intersect(r, Selection) Is Nothing Then
If Llist = "" Then
Llist = nm
Else
Llist = Llist & "," & nm
End If
End If
End If
Next sh
ary = Split(Llist, ",")
ActiveSheet.Shapes.Range((ary)).Select
End Sub