ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   CheckBox . . . (https://www.excelbanter.com/excel-programming/408193-checkbox.html)

SJohn

CheckBox . . .
 
I am new at Excel. I have on a worksheet 5 check boxes (A3 to A8)
I have them linked to B3 to A8. When a checkbox is activated in A3 then B3
shows "TRUE".
I am trying to make sure that only one of the 5 checkboxes can be activated
at any one time.
Any ideas?


Peter T

CheckBox . . .
 
Be conventional, use OptionButtons !

Regards,
Peter T

"SJohn" wrote in message
...
I am new at Excel. I have on a worksheet 5 check boxes (A3 to A8)
I have them linked to B3 to A8. When a checkbox is activated in A3 then B3
shows "TRUE".
I am trying to make sure that only one of the 5 checkboxes can be

activated
at any one time.
Any ideas?




FSt1

CheckBox . . .
 
hi
if you want only one check box set to true then set the others to false at
the same time. i.e.
Private Sub CheckBox1_Click()
If CheckBox1 = True Then
CheckBox2 = False
CheckBox3 = False
CheckBox4 = False
CheckBox4 = False
End If
End Sub

each check box would need code similar to above but as each check box is
checked(set to true) the others are set to false(unchecked) so the second
check box code would look something like this....
Private Sub CheckBox2_Click()
If CheckBox2 = True Then
CheckBox1 = False
CheckBox3 = False
CheckBox4 = False
CheckBox4 = False
End If
End Sub
and so on for each check box.

Regards
FSt1

"SJohn" wrote:

I am new at Excel. I have on a worksheet 5 check boxes (A3 to A8)
I have them linked to B3 to A8. When a checkbox is activated in A3 then B3
shows "TRUE".
I am trying to make sure that only one of the 5 checkboxes can be activated
at any one time.
Any ideas?


SJohn

CheckBox . . .
 
Do I have to define the variables? eg. CheckBox1, 2, etc. etc.

"FSt1" wrote:

hi
if you want only one check box set to true then set the others to false at
the same time. i.e.
Private Sub CheckBox1_Click()
If CheckBox1 = True Then
CheckBox2 = False
CheckBox3 = False
CheckBox4 = False
CheckBox4 = False
End If
End Sub

each check box would need code similar to above but as each check box is
checked(set to true) the others are set to false(unchecked) so the second
check box code would look something like this....
Private Sub CheckBox2_Click()
If CheckBox2 = True Then
CheckBox1 = False
CheckBox3 = False
CheckBox4 = False
CheckBox4 = False
End If
End Sub
and so on for each check box.

Regards
FSt1

"SJohn" wrote:

I am new at Excel. I have on a worksheet 5 check boxes (A3 to A8)
I have them linked to B3 to A8. When a checkbox is activated in A3 then B3
shows "TRUE".
I am trying to make sure that only one of the 5 checkboxes can be activated
at any one time.
Any ideas?



All times are GMT +1. The time now is 03:12 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com