A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

make command button invisible



 
 
Thread Tools Display Modes
  #1  
Old June 29th, 2004, 03:26 PM
Excel-VBA Dummy
external usenet poster
 
Posts: n/a
Default make command button invisible

Could someone please tell me the syntax to make a command
button visible or invisible?

I was hoping it would be something easy like:

commandbutton.visible = false

but that isn't working.

thanks for any help
  #2  
Old June 29th, 2004, 03:44 PM
Don Guillett
external usenet poster
 
Posts: n/a
Default make command button invisible

I just recorded this
Sub Macro7()
'
' Macro7 Macro
' Macro recorded 6/29/2004 by Don Guillett
'

'
Application.CommandBars("Control Toolbox").Visible = True
ActiveSheet.Shapes("CommandButton1").Select
Range("J15").Select
Application.CommandBars("Control Toolbox").Visible = False
End Sub

Seems like a lot of bother. Why not use a button from forms toolbar or a
shape from drawing. Easier.
Sub hideshape()
ActiveSheet.Shapes("rectangle 4").Visible = False
End Sub
--
Don Guillett
SalesAid Software

"Excel-VBA Dummy" wrote in message
...
Could someone please tell me the syntax to make a command
button visible or invisible?

I was hoping it would be something easy like:

commandbutton.visible = false

but that isn't working.

thanks for any help



  #3  
Old June 29th, 2004, 08:02 PM
Ken Macksey
external usenet poster
 
Posts: n/a
Default make command button invisible

If you use a command button from the "control toolbox " instead of the
"forms toolbar", you can set the visible property.

Commandbutton1.visible = False
or
Commandbutton1.visible = True


HTH

Ken


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.711 / Virus Database: 467 - Release Date: 25/06/2004


  #4  
Old June 30th, 2004, 01:40 PM
external usenet poster
 
Posts: n/a
Default make command button invisible

Thank you. This helped alot. I press the command button,
run a macro to make it invisible, copy the current
spreadsheet to another location, and then make the button
visible again.

The only thing that isn't working now - the button doesn't
become visible again, unless I close and re-open the
spreadsheet. Do you know how I can fix this?


-----Original Message-----
If you use a command button from the "control toolbox "

instead of the
"forms toolbar", you can set the visible property.

Commandbutton1.visible = False
or
Commandbutton1.visible = True


HTH

Ken


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.711 / Virus Database: 467 - Release Date:

25/06/2004


.

  #5  
Old June 30th, 2004, 11:28 PM
Ken Macksey
external usenet poster
 
Posts: n/a
Default make command button invisible

Hi

I am not sure exactly what you are trying to do, but try something like

ThisWorkbook.Sheets("sheet1").CommandButton1.Visib le = False
ThisWorkbook.Sheets("sheet2").Copy
ThisWorkbook.Activate
ThisWorkbook.Sheets("sheet1").CommandButton1.Visib le = True


HTH

Ken





---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.711 / Virus Database: 467 - Release Date: 25/06/2004


  #6  
Old July 1st, 2004, 01:42 PM
external usenet poster
 
Posts: n/a
Default make command button invisible

Thank you Ken. This got it working.

-----Original Message-----
Hi

I am not sure exactly what you are trying to do, but try

something like

ThisWorkbook.Sheets("sheet1").CommandButton1.Visi ble =

False
ThisWorkbook.Sheets("sheet2").Copy
ThisWorkbook.Activate
ThisWorkbook.Sheets("sheet1").CommandButton1.Visi ble =

True


HTH

Ken





---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.711 / Virus Database: 467 - Release Date:

25/06/2004


.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
MAKE EASY MOENY Rajkovaca Ante Worksheet Functions 0 January 2nd, 2004 09:51 PM


All times are GMT +1. The time now is 06:46 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.