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: 184
Default Delete all commandbuttons in workbook

Is there a way to delete all the commandbuttons in the entire
workbook? I found some code below that does it for a single sheet.
Thanks!

Sub DeleteCommandButtons()
Dim Obj As OLEObject
For Each Obj In ActiveSheet.OLEObjects
If Obj.progID = "Forms.CommandButton.1" Then
Obj.Delete
End If
Next Obj
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
How to Delete a Range in Closed Workbook (to Replace Delete Query) [email protected] Excel Discussion (Misc queries) 1 March 8th 06 10:10 AM
CommandButtons Mats Samson Excel Programming 4 January 17th 06 02:19 PM
Commandbuttons PCOR Excel Programming 1 May 11th 04 11:21 PM
delete commandbuttons on copied sheet qerj Excel Programming 6 February 16th 04 01:18 PM
commandbuttons properties Rui[_2_] Excel Programming 2 November 5th 03 04:07 PM


All times are GMT +1. The time now is 10:40 PM.

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

About Us

"It's about Microsoft Excel"