Sub GetShapesWhoseSurroundingRectangleTouchesTheSelectedRangeSomewhere()
Dim SH As Shape, ShapesInRange As String
For Each SH In ActiveSheet.Shapes
If Not Intersect(Range(SH.TopLeftCell.Address & ":" & SH.BottomRightCell.Address), Selection) Is Nothing Then
ShapesInRange = ShapesInRange & SH.Name & vbLf
End If
Next
If Len(ShapesInRange) Then
MsgBox ShapesInRange
Else
MsgBox "There are no shapes in that range!"
End If
End Sub
Sub GetShapesThatAreCompletelyWithinTheSelectedRangeOfCells()
Dim SH As Shape, ShapesInRange As String, Intersection As Range
For Each SH In ActiveSheet.Shapes
Set Intersection = Intersect(Range(SH.TopLeftCell.Address & ":" & SH.BottomRightCell.Address), Selection)
If Not Intersection Is Nothing Then
If Intersection.Address = Range(SH.TopLeftCell.Address & ":" & SH.BottomRightCell.Address).Address Then
ShapesInRange = ShapesInRange & SH.Name & vbLf
End If
End If
Next
If Len(ShapesInRange) Then
MsgBox ShapesInRange
Else
MsgBox "There are no shapes in that range!"
End If
End Sub