Dave has offered one solution. However, you say all the shapes will be in
the same cell (although shapes are not IN a cell, they are on a layer above
the cells).
As such, Dave's approach won't work
Assuming the shapes are rectangular or using their bounding box is
sufficient, you test for overlap with this function recently posted on
microsoft.public.vb.general.discussion:
http://groups.google.co.uk/group/mic...985fefb3dc65bb
Note, this is valid code, but not that clear. Read the whole thread to
understand it's meaning and simplify your own code:
Public Function RangesOverlapAmount(ByVal RangeA1 As Long, _
ByVal RangeA2 As Long, _
ByVal RangeB1 As Long, _
ByVal RangeB2 As Long) As Long
RangesOverlapAmount = Format((RangeA2 + RangeB2 - RangeA1 - _
RangeB1 - Abs(RangeA2 - RangeB2) - _
Abs(RangeA1 - RangeB1)) / 2, "0;\0")
End Function
If you have non-rectangular shapes that you have to test for overlap, a more
complex approach will be required, whereby the geometry of each shape is
taking into account.
NickHK
"SpaceCamel" <(E-Mail Removed)> wrote in message
news:52244C2A-5F52-4E11-8997-(E-Mail Removed)...
> I am automatically creating shapes within cells on a sheet but do not want
> them overlaping. I do not know how many there will be within each cell.
>
> Is the a way to determine if a new shape will overlap an existing one so
it
> can be shifted down out of the way?
>
> Thanks,