Thread: delete a shape
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
jasontferrell jasontferrell is offline
external usenet poster
 
Posts: 56
Default delete a shape

I'm not sure how to find the shape that is in a particular cell
directly. The approach I took is to look at all the shapes on the
sheet, then determine if they are in the active cell. This may not
work if you have too many shapes on the sheet. But if you only have a
few shapes, you can add this to the beginning of the subroutine you
listed above.

Dim shp As Shape, r As Range
For Each shp In ActiveSheet.Shapes
Set r = Intersect(ActiveCell, Range(shp.TopLeftCell,
shp.BottomRightCell))
If Not r Is Nothing Then
shp.Delete
End If
Next shp