Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 208
Default Removing a macro button after execution

I have created a button and have assigned a macro to it. How do I code the
existing macro to delete the button once the macro has executed?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default Removing a macro button after execution

Hi

Why not just make the button invisible?
Well, the below macro gives an example of both solutions.


Private Sub CommandButton1_Click()
msg = MsgBox("Hello")
Me.CommandButton1.Visible = False
'Me.CommandButton1.Delete
End Sub

Regards,
Per

"Bishop" skrev i meddelelsen
...
I have created a button and have assigned a macro to it. How do I code the
existing macro to delete the button once the macro has executed?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Removing a macro button after execution

The trick is to know the name

Sub deleteshapeafterrunningmacro()
MsgBox "hi"
With ActiveSheet
.Shapes("Rectangle 3").Cut
End With
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Bishop" wrote in message
...
I have created a button and have assigned a macro to it. How do I code the
existing macro to delete the button once the macro has executed?


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
show time of Refresh button execution Irina Excel Programming 0 January 13th 08 05:41 PM
Command Button Macro Execution Failure Dick Scheibe[_2_] Excel Programming 0 August 22nd 05 10:40 PM
Create a button to continue old macro execution Brian Excel Discussion (Misc queries) 0 May 15th 05 10:22 PM
stop code execution with button Al ramirez Excel Programming 0 October 1st 04 06:27 AM


All times are GMT +1. The time now is 01:34 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"