Removing objects without unmerging cells

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

When I use this code on a worksheet that doesn't contain
clip art to delete, I get the error message "This
operation will cause some merged cells to unmerge. Do you
want to continue". How can I use this code to delete
unwanted clip art objects without unmerging any cells?

Set myDocument = Worksheets(1)
myDocument.Shapes.SelectAll
Selection.Delete
 
one way:

Dim myDocument As Worksheet
Set myDocument = Worksheets(1)
With myDocument.Pictures
If .Count > 0 Then .Delete
End With
 
Thanks!...Works good!
-----Original Message-----
one way:

Dim myDocument As Worksheet
Set myDocument = Worksheets(1)
With myDocument.Pictures
If .Count > 0 Then .Delete
End With



.
 
Back
Top