Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
errrors while trying to delete a commandbutton | Excel Programming | |||
Delete Forms CommandButton on Worksheet | Excel Discussion (Misc queries) | |||
Commandbutton | Excel Programming | |||
Delete a Commandbutton from another Workbook | Excel Programming | |||
Commandbutton | Excel Programming |