Command button enabled dependant upon cell value

  • Thread starter Thread starter ian.curtis
  • Start date Start date
I

ian.curtis

Newbie question so take it easy boys and girls!

I have a command button on a worksheet which runs a macro and works
fine, but I want the button only to become enabled when the user has
entered a value into a cell.
How would I achieve this?


This is what I thought but it doesnt work where:

Worksheet name = PL3
Cell to have value = SUM_CHECK
command button = cmdAddToQuote
Macro to run = AddToQuote

Sheets("PL3").Select
If Range("SUM_CHECK").Value = 0 Then
cmdAddToQuote.Enabled = False
Else
cmdAddToQuote.Enabled = True

End If

Thanx in advance
 
Ian - The code that you have looks like it should work. Try stepping through
the program and check the value of Range("SUM_CHECK").Value to verify that
you enter the If statement at the correct times. If that is working as
expected then perhaps your command button is protected or on a different
worksheet.
 
Back
Top