View Full Version : [SOLVED:] Clearing shapes
mdmackillop
09-26-2005, 11:19 AM
Clearing shapes requires selecting then first, but if there are no shapes, the ActiveCell is deleted. What is the neatest way around this?
Sub DeleteDrawingObjects()
'Delete drawing objects from sheet
ActiveSheet.Shapes.SelectAll
Selection.Delete
End Sub
Jacob Hilderbrand
09-26-2005, 11:26 AM
If ActiveSheet.Shapes.Count > 0 Then
Clearing shapes requires selecting then first, but if there are no shapes, the ActiveCell is deleted. What is the neatest way around this?
Sub DeleteDrawingObjects()
'Delete drawing objects from sheet
ActiveSheet.Shapes.SelectAll
Selection.Delete
End Sub
how about
Sub DeleteDrawingObjects()
'Delete drawing objects from sheet
ActiveSheet.Shapes.SelectAll
If ActiveSheet.Shapes.Count > 0 Then Selection.Delete
End Sub
mdmackillop
09-26-2005, 01:32 PM
Thanks both. It's been a long, long day and the brain has stopped working!
Jacob Hilderbrand
09-26-2005, 01:50 PM
lol, glad to help :beerchug:
Take Care
Ivan F Moala
09-26-2005, 09:03 PM
No need to select them ...
ActiveSheet.DrawingObjects.Delete
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.