Delete a shape : Shape « Excel « VBA / Excel / Access / Word

Delete a shape


Sub DeleteShape()
   Set NewStar = ActiveSheet.Shapes.AddShape(msoShape4pointStar, LeftPos, TopPos, StarWidth, StarHeight)
   NewStar.Fill.ForeColor.SchemeColor = Int(Rnd() * 56)
   Application.Wait Now + TimeValue("00:00:01")
   Application.Wait Now + TimeValue("00:00:02")

   Set myShapes = Worksheets(1).Shapes
   For Each myShape In myShapes
      Application.Wait Now + TimeValue("00:00:01")
End Sub


Related examples in the same category

1.Get shape and output its z order
2.Draw a star
3.Create a shape and set its color
4.Looping through a Collection of Shapes
5.The OLEObjects Collection