adrian.groves
New Member
- Joined
- Aug 29, 2012
- Messages
- 18
Hi,
I have a need to delete many shapes on a worksheet although I wish to keep others. All of the shapes that I wish to delete are either lines or rectangles and the ones that I wish to keep are not. I had hoped the following would work, but it doess not - can anybody let me know what the correct code should be please?
I have a need to delete many shapes on a worksheet although I wish to keep others. All of the shapes that I wish to delete are either lines or rectangles and the ones that I wish to keep are not. I had hoped the following would work, but it doess not - can anybody let me know what the correct code should be please?
Dim shp As Shape
For Each shp In ActiveSheet.Shapes
If shp.LineShape = Line Then shp.Delete
If shp.LineShape = Rectangle Then shp.Delete
Next shp
ThanksFor Each shp In ActiveSheet.Shapes
If shp.LineShape = Line Then shp.Delete
If shp.LineShape = Rectangle Then shp.Delete
Next shp