deselect chart

M

MikeF

Need to select all shapes and delete them.
However there is a chart - "Chart1" - that needs to be deselected, as it
needs to remain on the sheet.

Have made numerous attempts, this one seems to make sense but doesn't work....
ActiveSheet.Shapes.SelectAll
ActiveSheet.Shapes("Chart1").Deselect

How do I select all shapes, then deselect Chart1?

Thanx,
- Mike
 
J

JLGWhiz

I have not tried this, but it might work.

Sub dk()
For Each s In ActiveSheet.Shapes
If s.Name <> "Chart1" Then
s.Delete
End If
Next
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top