LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 425
Default Delete all buttons on sheet

I inadvertently created a bunch of buttons on a sheet. I first tried
manually deleting them one by one but there are hundreds of them. I
found this code and ammended it to delete each button one by one, but
I keep running into a runtime error because I've deleted some of the
buttons out of sequence and it looks to actually run each line whether
the button number is there or not.

Is there a way that I can delete all buttons on a page regardless of
the number?

Sub DeleteButtons()
Application.DisplayAlerts = True
ActiveSheet.Unprotect
ActiveSheet.Shapes("Button 595").Select
Selection.Cut
' *** I ommitted the code for buttons 594 thru 2 so that I could post
here, but it's the same***
ActiveSheet.Shapes("Button 1").Select
Selection.Cut
Application.DisplayAlerts = True
ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True _
, AllowFiltering:=True
End Sub
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
delete option buttons [email protected] Excel Discussion (Misc queries) 2 September 25th 09 10:23 AM
Delete shapes, not buttons ewan7279 Excel Programming 3 July 17th 07 12:00 PM
Can't delete buttons Angeline Excel Discussion (Misc queries) 3 October 18th 06 02:43 AM
How to delete Radio buttons Ctech[_133_] Excel Programming 1 April 4th 06 10:02 AM
Delete Buttons Bill Martin Excel Discussion (Misc queries) 2 February 11th 06 06:26 AM


All times are GMT +1. The time now is 08:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"