Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 whe 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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. " wrote: 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 whe 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Apply Button Enabled | Excel Programming | |||
VB's Command Button vs Form's Command Button | Excel Programming | |||
option button dependant micro | Excel Programming | |||
Detect if a command bar is enabled in View-Toolbars | Excel Programming | |||
Command Button that changes cell properties | Excel Programming |