Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 168
Default Hide Buttons When a Cell is False

Is there a way to hide and unhide buttons when a cell is true/false? I use
this all the time for regular formulas within excel, but am not sure if it is
possible to hide actual buttons. Any help would be greatly apreciated.

Thanks

Adam Bush

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,202
Default Hide Buttons When a Cell is False

Assuming for this example that the cell you want to monitor is A1, this
Worksheet Change event code should do what you want; it makes the
CommandButton (what you are using, right?) visible if and only if the value
in the cell is TRUE...

Private Sub Worksheet_Change(ByVal Target As Range)
If Target = Range("A1") Then CommandButton1.Visible = Target.Value = "True"
End Sub

This version makes the CommandButton visible is the cell contains **any**
entry...

Private Sub Worksheet_Change(ByVal Target As Range)
If Target = Range("A1") Then CommandButton1.Visible = Target.Value < ""
End Sub

Rick


"
m wrote in message
...
Is there a way to hide and unhide buttons when a cell is true/false? I
use
this all the time for regular formulas within excel, but am not sure if it
is
possible to hide actual buttons. Any help would be greatly apreciated.

Thanks

Adam Bush


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 168
Default Hide Buttons When a Cell is False

Rick,

Great! Thanks for your help. I appreciate the speedy response.

Thanks

Adam Bush

"Rick Rothstein (MVP - VB)" wrote:

Assuming for this example that the cell you want to monitor is A1, this
Worksheet Change event code should do what you want; it makes the
CommandButton (what you are using, right?) visible if and only if the value
in the cell is TRUE...

Private Sub Worksheet_Change(ByVal Target As Range)
If Target = Range("A1") Then CommandButton1.Visible = Target.Value = "True"
End Sub

This version makes the CommandButton visible is the cell contains **any**
entry...

Private Sub Worksheet_Change(ByVal Target As Range)
If Target = Range("A1") Then CommandButton1.Visible = Target.Value < ""
End Sub

Rick


"
m wrote in message
...
Is there a way to hide and unhide buttons when a cell is true/false? I
use
this all the time for regular formulas within excel, but am not sure if it
is
possible to hide actual buttons. Any help would be greatly apreciated.

Thanks

Adam Bush



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
TRUE/FALSE MACRO using Option Buttons Jase Excel Discussion (Misc queries) 1 March 28th 08 09:15 PM
Hide Buttons when a Cell is False [email protected] Excel Discussion (Misc queries) 0 January 23rd 08 01:52 AM
Excel Yes / No, True / False etc. cell selection buttons? Harrison[_2_] Excel Worksheet Functions 1 July 4th 07 04:50 AM
option buttons' values = false Spencer Hutton[_3_] Excel Programming 1 January 28th 05 10:07 PM
Hide Rows If Cell Value = False TOMB[_2_] Excel Programming 3 May 17th 04 07:44 PM


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