Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 17
Default enable/disable button based on cell value

Hello,

I have created a toggle button from the Control Toolbox. The function of
the button is to hide/unhide columns. What I would like to do is make the
button available based on a cell's value.

More specifically, what I would like to do is enable the button only if cell
A1 has a value that is less than half of the value in B1.

Please let me know if this is possible, and if it is, how I should do it.

Thanks for any help you can provide.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 477
Default enable/disable button based on cell value

Try

Private Sub Worksheet_Change(ByVal Target As Range)
Dim Temp As Double
Temp = Range("A1") / Range("B1")
If Temp < 0.5 Then
ToggleButton1.Enabled = True
Else: ToggleButton1.Enabled = False
End If
End Sub


"Shoney" wrote:

Hello,

I have created a toggle button from the Control Toolbox. The function of
the button is to hide/unhide columns. What I would like to do is make the
button available based on a cell's value.

More specifically, what I would like to do is enable the button only if cell
A1 has a value that is less than half of the value in B1.

Please let me know if this is possible, and if it is, how I should do it.

Thanks for any help you can provide.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 17
Default enable/disable button based on cell value

Thanks Jim! That was exactly what I was looking for, works exactly as I had
hoped.

"Jim May" wrote:

Try

Private Sub Worksheet_Change(ByVal Target As Range)
Dim Temp As Double
Temp = Range("A1") / Range("B1")
If Temp < 0.5 Then
ToggleButton1.Enabled = True
Else: ToggleButton1.Enabled = False
End If
End Sub


"Shoney" wrote:

Hello,

I have created a toggle button from the Control Toolbox. The function of
the button is to hide/unhide columns. What I would like to do is make the
button available based on a cell's value.

More specifically, what I would like to do is enable the button only if cell
A1 has a value that is less than half of the value in B1.

Please let me know if this is possible, and if it is, how I should do it.

Thanks for any help you can provide.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 17
Default enable/disable button based on cell value

Jim,

Is there any way to adjust this macro to include another cell as well? I'm
working w/ the same button, but just want to add that if cell C1 = n/a,
disable the button.

I've tried some combinations that I thought would work, even copying the
macro and pasting it again (two of the same, w/a different range value), to
no avail.

Please let me know if there is anything I can do, or if I'll need to go a
different route.

Thank you,

"Jim May" wrote:

Try

Private Sub Worksheet_Change(ByVal Target As Range)
Dim Temp As Double
Temp = Range("A1") / Range("B1")
If Temp < 0.5 Then
ToggleButton1.Enabled = True
Else: ToggleButton1.Enabled = False
End If
End Sub


"Shoney" wrote:

Hello,

I have created a toggle button from the Control Toolbox. The function of
the button is to hide/unhide columns. What I would like to do is make the
button available based on a cell's value.

More specifically, what I would like to do is enable the button only if cell
A1 has a value that is less than half of the value in B1.

Please let me know if this is possible, and if it is, how I should do it.

Thanks for any help you can provide.

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
Combo Box enable and disable Vinod[_2_] Excel Worksheet Functions 3 November 6th 07 06:30 PM
enable/disable macro RICK Excel Discussion (Misc queries) 4 June 15th 06 07:55 PM
Conditional formatting based on decision to enable/disable macros? zenahs Excel Discussion (Misc queries) 1 November 15th 05 08:40 PM
Enable/Disable macros Adam Excel Discussion (Misc queries) 2 March 11th 05 11:29 AM
VBA: Disable Frame and Radio Buttons based on Another Radio Button Being True Mcasteel Excel Worksheet Functions 2 October 29th 04 07:06 PM


All times are GMT +1. The time now is 12:48 AM.

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"