Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Simple Question: Hiding a CommandButton

Hello,

I am really bad at writing VBA scripts and I want something very simpl
done in a sheet. The thing is I have a commandbutton that I only want t
be visible when a certain cell (which is only changed by a Drop Dow
box) contains the number "7". I know this should be pretty easy, but
just can't get the right code in there.

Can anyone please help? Thank you in advance,

Jasper Blaa

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Simple Question: Hiding a CommandButton

Hi Jasper,

Right-click the sheet tab and paste the following code:

Private Sub Worksheet_Change(ByVal Target As Range)
CommandButton1.Visible = Range("A1") = 7
End Sub


Change the cell refence and the name of the command button to accord with
your needs.

---
Regards,
Norman



"JasperBlaas " wrote in message
...
Hello,

I am really bad at writing VBA scripts and I want something very simple
done in a sheet. The thing is I have a commandbutton that I only want to
be visible when a certain cell (which is only changed by a Drop Down
box) contains the number "7". I know this should be pretty easy, but I
just can't get the right code in there.

Can anyone please help? Thank you in advance,

Jasper Blaas


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Simple Question: Hiding a CommandButton

Hi Jasper

Right-click the sheet tab | View Code | and paste ...


---
Regards,
Norman



"Norman Jones" wrote in message
...
Hi Jasper,

Right-click the sheet tab and paste the following code:

Private Sub Worksheet_Change(ByVal Target As Range)
CommandButton1.Visible = Range("A1") = 7
End Sub


Change the cell refence and the name of the command button to accord with
your needs.

---
Regards,
Norman



"JasperBlaas " wrote in

message
...
Hello,

I am really bad at writing VBA scripts and I want something very simple
done in a sheet. The thing is I have a commandbutton that I only want to
be visible when a certain cell (which is only changed by a Drop Down
box) contains the number "7". I know this should be pretty easy, but I
just can't get the right code in there.

Can anyone please help? Thank you in advance,

Jasper Blaas


---
Message posted from http://www.ExcelForum.com/





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Simple Question: Hiding a CommandButton

Hi Norman,

Thanks! It's working perfectly.

Jasper

--
Message posted from http://www.ExcelForum.com

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
IF formula-simple question; simple operator Rich D Excel Discussion (Misc queries) 4 December 6th 07 03:36 PM
Simple Simple Excel usage question BookerW Excel Discussion (Misc queries) 1 June 23rd 05 10:06 PM
Create simple commandbutton for manual recalculation Bryan Linton Excel Programming 2 August 6th 04 10:30 PM
simple question, hopefully a simple answer! Matt B Excel Programming 5 January 13th 04 08:43 PM
Simple hiding columns with vba does not work with a checkbox Brian Excel Programming 3 January 9th 04 10:39 PM


All times are GMT +1. The time now is 10:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"