View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
FSt1 FSt1 is offline
external usenet poster
 
Posts: 3,942
Default Self canceling checkboxes

hi
a check box cannot be set to "cancel" itself. but checkboxes can be set to
cancel other checkboxes.
example.....3 checkboxes.(activeX, not form)
code in checkbox1...............
Private Sub CheckBox1_Click()
If CheckBox1 = True Then
CheckBox2 = False
CheckBox3 = False
End If
End Sub
code in checkbox 2...............
Private Sub CheckBox2_Click()
If CheckBox2 = True Then
CheckBox1 = False
CheckBox3 = False
End If
End Sub
code in checkbox3................
Private Sub CheckBox3_Click()
If CheckBox3 = True Then
CheckBox2 = False
CheckBox1 = False
End If
End Sub
as you can see, when setting any checkbox to true, code in each automaticly
sets all other checkboxes to false. simple, huh. but depending on how may
check boxes you have, this technique can get lengthy and wordy. you mentioned
2. i supplied code for 3.
dave's suggestion has some strong merrit but personally i have never had
much use for optilons boxes. that may be due to my experiences and what i
have been required to do over the years. and then again i guess we are all
allowed at least one stupid opinion. some people have more. really.
my point is that dave did not address the question, only diverted attention.
i am attempted to answer the question while admitting that there is more than
one way to handle this situation. "best" is sometimes a matter of situation
and opinion. your situation, your call.

regards
FSt1

"Glenn" wrote:

Is there anyway to set the checkboxes to self cancel? I have a list setup
and i would like to only select one of the two items with a checkmark, both
checkmarks on the same row cannot be checked... or is there some easier way
to do this? I would also like to be able to print this out as well and have
it completed by hand, hence the check box.