Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2008

Tip: Looking for answers? Try searching our database.

Hide Buttons When a Cell is False

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
adambush4242@hotmail.com - 24 Jan 2008 17:51 GMT
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
Rick Rothstein (MVP - VB) - 24 Jan 2008 18:48 GMT
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

> Is there a way to hide and unhide buttons when a cell is true/false?  I
> use
[quoted text clipped - 5 lines]
>
> Adam Bush
adambush4242@hotmail.com - 24 Jan 2008 20:12 GMT
Rick,

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

Thanks

Adam Bush

> 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
[quoted text clipped - 23 lines]
> >
> > Adam Bush
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.