Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete All Objects On Activesheet

Status
Not open for further replies.

TopJack

Programmer
Mar 10, 2001
153
GB
I'm sure this is an easy one for you VB Gurus.

I want to delete all shape objects on an Activesheet.

I am adding objects using this method :-

ActiveSheet.Shapes.AddShape(msoShapeOval,10,10,5,5).Select

I know I should have this one in the bag, but tonight I seem to have a mental block.

Any help would be appreciated. Thanks.
 
summat like dis ??
For each shp in activesheet.shapes
shp.delete
next Rgds
Geoff
"Some cause happiness wherever they go; others whenever they go."
-Oscar Wilde
 
Thanks Geoff. Perfect. From your help I actually used this .......

Set myDocument = Worksheets(1)

For Each sh In myDocument.Shapes
sh.Fill.ForeColor.RGB = RGB(255, 0, 0)
Next
 
Sorry I pasted the wrong code.

This is what I actually used .....

For Each sh In ActiveSheet.Shapes
If sh.AutoShapeType = msoShapeOval Then
ActiveSheet.Shapes.Range(sh.name).Delete
End If
Next


I'm sure there is other ways to do this, but this works great.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top