Checkbox Question

  • Thread starter Thread starter slow386
  • Start date Start date
S

slow386

Hi Folks:

I have a sheet with two checkboxes for the selection of two options (that
can not be used together).
Is there a way that if for example, box A is checked, box B is unchecked ??

Thanks much
Steve
 
I may be looking in the wrong location, but - - - my option buttons do not
have a tab for Format Control and a cell link location !!
I'm using Excel 2003 with SP2 on XP-Pro with all SP's

I checked two other machines in the office, and they both have the proper
tab.

Any thoughts??
 
There are 2 different kinds of option buttons and they are found in
different locations, the Forms Toolbar and the Control Toolbox.

Those in the Control Toolbox are designed to be used with VBA code. You
should use the option buttons from the Forms Toolbar.

Right click any toolbar and then select Forms. You'll see the option button.

Biff
 
Try the optionbuttons from the Forms toolbar (not from the Control Toolbox
toolbar).

But you could change the .linkedcell property if you want to use the
optionbuttons from the Control Toolbox toolbar.
 
You guys are great - thanks.
As my grandfather used to say, you need the right tool for the job.

Steve
 
I had the same issue. I wanted to use a checkbox and not option buttons
because option buttons control every option button on the sheet. This is how
I was able to use checkboxes and have it when box A is check, box B becomes
unchecked.

Link your checkboxes to their respective cells.
Checkbox A with A1
Checkbox B with B1

Then on Checkbox A use this code:

Option Explicit
Sub Checkbox_A()
Dim myCBX As CheckBox
Set myCBX = ActiveSheet.CheckBoxes(Application.Caller)

If myCBX.Value = xlOn Then
myCBX.TopLeftCell.Offset(0, 1).Value = False
End If

End Sub


Then on Checkbox B use this code:

Option Explicit
Sub Checkbox_B()
Dim myCBX As CheckBox
Set myCBX = ActiveSheet.CheckBoxes(Application.Caller)

If myCBX.Value = xlOn Then
myCBX.TopLeftCell.Offset(0, -1).Value = False
End If

End Sub


This will do the trick. I was tired of everyone telling me to use option
button so I did it myself.

p.s. - to not see the "TRUE/FALSE" under the checkboxed, just change the
color of the text to match the background

~Ryan
 
If you use optionbuttons from the Forms toolbar, you can place each group in its
own groupbox. Then they will behave the way you want.
 
Back
Top