Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Make a button disappear

Is there a specific piece of code to remove a form/control button from a
worksheet? Have tried many things, none of them working! I don't mind if
it's just hidden actually, so long as it can't be seen by the end user once
the code has run its course
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Make a button disappear

Try this

ActiveSheet.Shapes("yourbutton").Visible = False

Or

ActiveSheet.Shapes("yourbutton").Delete


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Aaron Howe" wrote in message ...
Is there a specific piece of code to remove a form/control button from a
worksheet? Have tried many things, none of them working! I don't mind if
it's just hidden actually, so long as it can't be seen by the end user once
the code has run its course



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Make a button disappear

for a commandbutton
Activesheet.Shapes("CommandButton1").Delete

or

Activesheet.Shapes("CommandButton1").Visible = False

for a button from the forms toolbar

Activesheet.Buttons("Button 1").Delete

or

Activesheet.buttons("button 1").Visible = False


If you are going to use the button again, I would hide and unhide it rather
than adding a new button each time.

--
Regards,
Tom Ogilvy


"Aaron Howe" wrote in message
...
Is there a specific piece of code to remove a form/control button from a
worksheet? Have tried many things, none of them working! I don't mind if
it's just hidden actually, so long as it can't be seen by the end user

once
the code has run its course



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Make a button disappear

That worked, have never heard of the Shapes command before though!!
Thanks ;-)

"Tom Ogilvy" wrote:

for a commandbutton
Activesheet.Shapes("CommandButton1").Delete

or

Activesheet.Shapes("CommandButton1").Visible = False

for a button from the forms toolbar

Activesheet.Buttons("Button 1").Delete

or

Activesheet.buttons("button 1").Visible = False


If you are going to use the button again, I would hide and unhide it rather
than adding a new button each time.

--
Regards,
Tom Ogilvy


"Aaron Howe" wrote in message
...
Is there a specific piece of code to remove a form/control button from a
worksheet? Have tried many things, none of them working! I don't mind if
it's just hidden actually, so long as it can't be seen by the end user

once
the code has run its course




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
Why does the 'data' button disappear... Rich Charts and Charting in Excel 0 February 13th 08 04:33 PM
Insert Options button doesn't disappear Seraph Excel Discussion (Misc queries) 0 April 25th 06 02:09 PM
How to make excel disappear! grandfilth Excel Discussion (Misc queries) 4 October 28th 05 12:28 AM
How do I make it disappear? Ralphael1 New Users to Excel 1 October 12th 05 12:19 AM
how to make dropdown arrow disappear in vba mango Excel Worksheet Functions 2 November 30th 04 12:56 AM


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