Objects above cell

  • Thread starter Thread starter Geoff
  • Start date Start date
One way is to loop through all the objects/shapes.

Option Explicit
Sub testme()
Dim myShape As Shape
Dim myRng As Range
Dim myCell As Range

With ActiveSheet
Set myCell = .Range("G12")
For Each myShape In .Shapes
Set myRng = .Range(myShape.TopLeftCell, myShape.BottomRightCell)
If Intersect(myRng, myCell) Is Nothing Then
'nope, keep looking
Else
MsgBox "Found: " & myShape.Name & " above " _
& myCell.Address(0, 0)
'keep looking or
'exit for
End If
Next myShape
End With

End Sub
 
Back
Top