Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
TRUE/FALSE MACRO using Option Buttons | Excel Discussion (Misc queries) | |||
Hide Buttons when a Cell is False | Excel Discussion (Misc queries) | |||
Excel Yes / No, True / False etc. cell selection buttons? | Excel Worksheet Functions | |||
option buttons' values = false | Excel Programming | |||
Hide Rows If Cell Value = False | Excel Programming |