PC Review


Reply
Thread Tools Rate Thread

Command button enabled dependant upon cell value

 
 
ian.curtis@service.britgas.co.uk
Guest
Posts: n/a
 
      28th Nov 2006
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

 
Reply With Quote
 
 
 
 
=?Utf-8?B?Q29yeQ==?=
Guest
Posts: n/a
 
      28th Nov 2006
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.

"(E-Mail Removed)" 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 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
>
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Command Button not Enabled JimS Microsoft Access Form Coding 2 16th Jun 2009 05:57 PM
Command Button Enabled =?Utf-8?B?R3VzIENodWNo?= Microsoft Access Forms 1 29th Oct 2006 03:13 PM
Re: Command Button visible dependant on a value Al Camp Microsoft Access 1 28th Nov 2005 01:08 AM
Re: Command Button visible dependant on a value Graham Mandeno Microsoft Access 0 24th Nov 2005 10:10 PM
Changing the enabled value for a command button. =?Utf-8?B?SmFtZXM=?= Microsoft Access Form Coding 3 26th Feb 2005 10:47 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:46 PM.