Article ID: 125179
Article Last Modified on 10/11/2006
Arc, Button, ChartObject, CheckBox, Drawing, DropDown, GroupBox, GroupObject, Label, Line, ListBox, OLEObject, OptionButton, Oval, Picture, Rectangle, ScrollBar, Spinner, and TextBox.
Sub DeleteObjects()
' Define a For-Each loop of all the drawing objects on the
' active worksheet.
For Each DrawObj In ActiveSheet.DrawingObjects
' Define Cell_Ref as the top left cell address of each Drawing
' Object.
Cell_Ref = DrawObj.TopLeftCell.Address
' Define a For-Each loop of all the cells with the range
' Print_Area.
For Each Cell In Range("Print_Area")
' If the Object's top left cell address is the same as a
' cell in the print range.
If Cell_Ref = Cell.Address Then
' Then delete the object.
DrawObj.Delete
' End the IF statement.
End If
' Loop through next cell.
Next Cell
' Loop through next DrawObj.
Next DrawObj
End Sub
Additional query words: 5.00c XL97 XL98 XL7 XL5 XL
Keywords: kbdtacode kbhowto kbprogramming KB125179