ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Hidding buttons (https://www.excelbanter.com/excel-programming/404244-hidding-buttons.html)

Steve[_105_]

Hidding buttons
 
Hello!

I have a button that i want to be hidden unless a certain cell has a
certain value.

Any ideas?

Thanks

Steve


---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 080114-1, 14/01/2008
Tested on: 14/01/2008 16:05:29
avast! - copyright (c) 1988-2008 ALWIL Software.
http://www.avast.com




Dave Peterson

Hidding buttons
 
Maybe you could use a worksheet_change event or worksheet_Calculate.

It would depend on how that cell changes (by formula or by typing) and what kind
of button it is. (Is it an optionbutton from the Forms toolbar or an
optionbutton from the control toolbox toolbar--or is it a button from the Forms
toolbar or a commandbutton from the control toolbox toolbar?)


Steve wrote:

Hello!

I have a button that i want to be hidden unless a certain cell has a
certain value.

Any ideas?

Thanks

Steve

---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 080114-1, 14/01/2008
Tested on: 14/01/2008 16:05:29
avast! - copyright (c) 1988-2008 ALWIL Software.
http://www.avast.com


--

Dave Peterson

Steve[_106_]

Hidding buttons
 
Dave Peterson wrote in
:

Maybe you could use a worksheet_change event or worksheet_Calculate.

It would depend on how that cell changes (by formula or by typing) and
what kind of button it is. (Is it an optionbutton from the Forms
toolbar or an optionbutton from the control toolbox toolbar--or is it
a button from the Forms toolbar or a commandbutton from the control
toolbox toolbar?)


Steve wrote:

Hello!

I have a button that i want to be hidden unless a certain cell has a
certain value.

Any ideas?

Thanks

Steve

---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 080114-1, 14/01/2008
Tested on: 14/01/2008 16:05:29
avast! - copyright (c) 1988-2008 ALWIL Software.
http://www.avast.com



Hi, Yes its a commandbutton from the control toolbox tollbar. Also I
would like to know both (Formula and by typing) As I will be using both
at some point.

Thanks


---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 080114-2, 14/01/2008
Tested on: 14/01/2008 16:42:13
avast! - copyright (c) 1988-2008 ALWIL Software.
http://www.avast.com




Dave Peterson

Hidding buttons
 
Option Explicit
'based on a formula in B1
Private Sub Worksheet_Calculate()
Me.CommandButton1.Visible _
= Not (CBool(LCase(Me.Range("b1")) = LCase("hide")))
End Sub

'based on typing in A1
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub
If Intersect(Target, Me.Range("a1")) Is Nothing Then Exit Sub

Me.CommandButton1.Visible _
= Not (CBool(LCase(Target.Value) = LCase("hide")))
End Sub


Steve wrote:

Dave Peterson wrote in
:

Maybe you could use a worksheet_change event or worksheet_Calculate.

It would depend on how that cell changes (by formula or by typing) and
what kind of button it is. (Is it an optionbutton from the Forms
toolbar or an optionbutton from the control toolbox toolbar--or is it
a button from the Forms toolbar or a commandbutton from the control
toolbox toolbar?)


Steve wrote:

Hello!

I have a button that i want to be hidden unless a certain cell has a
certain value.

Any ideas?

Thanks

Steve

---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 080114-1, 14/01/2008
Tested on: 14/01/2008 16:05:29
avast! - copyright (c) 1988-2008 ALWIL Software.
http://www.avast.com



Hi, Yes its a commandbutton from the control toolbox tollbar. Also I
would like to know both (Formula and by typing) As I will be using both
at some point.

Thanks

---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 080114-2, 14/01/2008
Tested on: 14/01/2008 16:42:13
avast! - copyright (c) 1988-2008 ALWIL Software.
http://www.avast.com


--

Dave Peterson


All times are GMT +1. The time now is 07:05 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com