Does a shape cover a cell ?
I should also have noted that if you want to find out if the shape _Visually_ covers part of a cell,
you are out of luck - the drawing object is rectangular, even if visually it is a line, or curve or
something else.
HTH,
Bernie
MS Excel MVP
"Bernie Deitrick" <deitbe @ consumer dot org wrote in message
...
Gary's Student,
Function Cover(strShapeName As String, cAdd As String) As Variant
On Error GoTo ErrHandler
With Range(cAdd).Parent.Shapes(strShapeName)
Cover = Not Intersect(Range(cAdd), Range(.TopLeftCell, .BottomRightCell)) Is Nothing
End With
Exit Function
ErrHandler:
Cover = "Bad :-("
End Function
Sub TestTheFunction()
MsgBox Cover("Rectangle 1", "C4")
End Sub
--
HTH,
Bernie
MS Excel MVP
"Gary''s Student" wrote in message
...
I need a simple boolean function that, give the name of a shape and the
address of a single cell, will return TRUE if the cell is fully or partially
covered by the shape. Otherwise FALSE.
Thanks in advance
--
Gary''s Student - gsnu200764
|