Google Answers Logo
View Question
 
Q: EXCEL Check boxes including "None of the above" checkbox ( Answered,   1 Comment )
Question  
Subject: EXCEL Check boxes including "None of the above" checkbox
Category: Computers > Software
Asked by: skyone-ga
List Price: $10.00
Posted: 15 Jan 2005 10:02 PST
Expires: 14 Feb 2005 10:02 PST
Question ID: 457684
I have created a series of EXCEL check boxes as follows:

       Option 1
       Option 2
       Option 3
       Option 4
       None of the Above	

Right now, they are programmed so that if they are checked, they have
the value ?TRUE? and when they are not checked, they have the value
?FALSE?.

I would like to program it so that if the option ?None of the above?
is checked,  all of the other ?checks? in the other options are
removed (i.e., no checks appear on the spreadsheet) and these options
should also then have a ?FALSE? value.

Can you tell me how to set this up properly?  Thanks!
Answer  
Subject: Re: EXCEL Check boxes including "None of the above" checkbox
Answered By: maniac-ga on 17 Jan 2005 18:48 PST
 
Hello Skyone,

See the source code at the end for reference.

I created an option checkbox and assigned its macro to CheckBox1_Click.
  Right Click -> Assign Macro
and entered the name in the field. I also used
  Right Click -> Format Control...
and created a cell link to $A$1.

I copied / pasted that checkbox four times. For each, I revised the
cell link to $A$2 through $A$5. I also fixed the name (Option 2, 3, 4,
None of the Above). For the last copy I used Assign Macro to change
the name to None_Click.

Open the Visual Basic Editor
  Right Click -> Assign Macro -> Edit
which should bring up the Visual Basic Editor and a "module window" in
the current worksheet. Then copy / paste the code below into the
window. Return to Excel using
  Close and Return to Microsoft Excel

At this point, you should be able to get the behavior you described
(plus if you check any option - None of the Above is reset).

If you need to relocate the cell references, put the appropriate row /
column for each reference in the code below. I assumed the option
values are on consecutive rows; if not, please make a clarification
request so I can suggest another way to code the None_Click
subroutine.

If you have any problems following these instructions or they do not
work right on your system - please make a clarification request so I
can help you more fully.

  --Maniac

----------

Sub CheckBox1_Click()
    ActiveSheet.Cells(5, 1) = False
End Sub
Sub None_Click()
    For I = 1 To 4
        ActiveSheet.Cells(I, 1) = False
    Next I
End Sub
Comments  
Subject: Re: EXCEL Check boxes including "None of the above" checkbox
From: crythias-ga on 16 Jan 2005 15:05 PST
 
You'd set up an "onclick" or "onmouseup" macro. When action occurs,
option1=False, option2=False, etc...

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy