View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Shoney Shoney is offline
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.