Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Delete Commandbutton?


I'd like to be able to press one command button which deletes another
command button on a different worksheet - is this possible?

many thanks


--
bluegnu
------------------------------------------------------------------------
bluegnu's Profile: http://www.excelforum.com/member.php...o&userid=36108
View this thread: http://www.excelforum.com/showthread...hreadid=559824

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Delete Commandbutton?

Attach this to the button macro

Worksheets("Sheet3").Buttons("Button 1").Delete


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"bluegnu" wrote in
message ...

I'd like to be able to press one command button which deletes another
command button on a different worksheet - is this possible?

many thanks


--
bluegnu
------------------------------------------------------------------------
bluegnu's Profile:

http://www.excelforum.com/member.php...o&userid=36108
View this thread: http://www.excelforum.com/showthread...hreadid=559824



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Delete Commandbutton?

Hi BlueGnu,

Try:

'=============
Private Sub CommandButton1_Click()
Dim MyButton As OLEObject
On Error Resume Next
Set MyButton = ThisWorkbook.Sheets("Sheet2"). _
OLEObjects("Commandbutton5")
On Error GoTo 0
If Not MyButton Is Nothing Then
MyButton.Delete
Else
MsgBox "CommandButton already deleted or not found"
End If

End Sub
'<<=============


---
Regards,
Norman



"bluegnu" wrote in
message ...

I'd like to be able to press one command button which deletes another
command button on a different worksheet - is this possible?

many thanks


--
bluegnu
------------------------------------------------------------------------
bluegnu's Profile:
http://www.excelforum.com/member.php...o&userid=36108
View this thread: http://www.excelforum.com/showthread...hreadid=559824



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Delete Commandbutton?


Thanks for the response.

I get the message "unable to get buttons property of worksheet class"
when I press the button. Any idea what I'm doing wrong? I've ensured
the button isn't locked or anything.


--
bluegnu
------------------------------------------------------------------------
bluegnu's Profile: http://www.excelforum.com/member.php...o&userid=36108
View this thread: http://www.excelforum.com/showthread...hreadid=559824

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Delete Commandbutton?

Is it a control toolbox button?

Worksheets("Sheet3").OleObjects("Button 1").Delete


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"bluegnu" wrote in
message ...

Thanks for the response.

I get the message "unable to get buttons property of worksheet class"
when I press the button. Any idea what I'm doing wrong? I've ensured
the button isn't locked or anything.


--
bluegnu
------------------------------------------------------------------------
bluegnu's Profile:

http://www.excelforum.com/member.php...o&userid=36108
View this thread: http://www.excelforum.com/showthread...hreadid=559824





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Delete Commandbutton?


Thanks very much, they worked well

--
bluegn
-----------------------------------------------------------------------
bluegnu's Profile: http://www.excelforum.com/member.php...fo&userid=3610
View this thread: http://www.excelforum.com/showthread.php?threadid=55982

Reply
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
errrors while trying to delete a commandbutton funkymonkUK[_195_] Excel Programming 11 June 28th 06 10:26 AM
Delete Forms CommandButton on Worksheet Jim May Excel Discussion (Misc queries) 7 June 5th 06 10:29 PM
Commandbutton alvin Kuiper Excel Programming 6 November 27th 05 06:28 PM
Delete a Commandbutton from another Workbook jase[_2_] Excel Programming 5 June 3rd 05 03:15 PM
Commandbutton David Fixemer Excel Programming 2 February 25th 04 10:18 PM


All times are GMT +1. The time now is 09:11 PM.

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"