ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Checkbox Question (https://www.excelbanter.com/excel-discussion-misc-queries/140423-checkbox-question.html)

slow386

Checkbox Question
 
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



JMay

Checkbox Question
 
You want to use option buttons, not checkboxes.


"slow386" wrote:

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




slow386

Checkbox Question
 
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??

"JMay" wrote in message
...
You want to use option buttons, not checkboxes.


"slow386" wrote:

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






T. Valko

Checkbox Question
 
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

"slow386" wrote in message
...
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??

"JMay" wrote in message
...
You want to use option buttons, not checkboxes.


"slow386" wrote:

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








Dave Peterson

Checkbox Question
 
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.

slow386 wrote:

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??

"JMay" wrote in message
...
You want to use option buttons, not checkboxes.


"slow386" wrote:

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




--

Dave Peterson

Slow386

Checkbox Question
 
You guys are great - thanks.
As my grandfather used to say, you need the right tool for the job.

Steve

"Dave Peterson" wrote in message
...
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.

slow386 wrote:

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??

"JMay" wrote in message
...
You want to use option buttons, not checkboxes.


"slow386" wrote:

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




--

Dave Peterson




Texas Aggie

Checkbox Question
 
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
--
Silverbird Designs @ www.silverbirddesigns.com

Fighting Texas Aggie Class of 2009


"slow386" wrote:

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




Dave Peterson

Checkbox Question
 
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.

Texas Aggie wrote:

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
--
Silverbird Designs @ www.silverbirddesigns.com

Fighting Texas Aggie Class of 2009

"slow386" wrote:

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




--

Dave Peterson


All times are GMT +1. The time now is 04:14 AM.

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