I need to set up 3 option boxes that are mutually exclusive.
When I click on one option box the other two should be unchecked
etc.etc.
How do I go about doing this - I had a look through the forum but I
can't seem to find a solution.

Thanks

Re: Mutually Exclusive Option Boxes by Fred

Fred
Fri Jul 25 07:56:51 CDT 2008

If you are using the form control option buttons then put them inside a
group box. All option buttons inside a group box are mutually exclusive.
If you are using the ActiveX option buttons then set the Groupname property
on each of the option buttons to the same value.

Regards,
Fred

"5elpep" <5elpep@gmail.com> wrote in message
news:2533323e-fda7-41b0-b9e0-6a70c8bb21aa@u6g2000prc.googlegroups.com...
>I need to set up 3 option boxes that are mutually exclusive.
> When I click on one option box the other two should be unchecked
> etc.etc.
> How do I go about doing this - I had a look through the forum but I
> can't seem to find a solution.
>
> Thanks



Re: Mutually Exclusive Option Boxes by 5elpep

5elpep
Fri Jul 25 08:19:55 CDT 2008

On Jul 25, 1:56=A0pm, "Fred" <leavemealone@home> wrote:
> If you are using the form control option buttons then put them inside a
> group box. All option buttons inside a group box are mutually exclusive.
> If you are using the ActiveX option buttons then set the Groupname proper=
ty
> on each of the option buttons to the same value.
>
> Regards,
> Fred
>
> "5elpep" <5el...@gmail.com> wrote in message
>
> news:2533323e-fda7-41b0-b9e0-6a70c8bb21aa@u6g2000prc.googlegroups.com...
>
>
>
> >I need to set up 3 option boxes that are mutually exclusive.
> > When I click on one option box the other two should be unchecked
> > etc.etc.
> > How do I go about doing this - I had a look through the forum but I
> > can't seem to find a solution.
>
> > Thanks- Hide quoted text -
>
> - Show quoted text -

Sorry I should have been more specific - I am usin the controls
toolbox.

Re: Mutually Exclusive Option Boxes by Dave

Dave
Fri Jul 25 09:05:46 CDT 2008

ActiveX is another name for the same Control toolbox toolbar controls.

Rightclick on each option button that should be grouped together. Select
properties and make sure each optionbutton in a group has the same unique
groupname.

By default the groupname for all the optionbuttons is the sheet name. That's
why they start out all grouped together.

5elpep wrote:
>
> On Jul 25, 1:56 pm, "Fred" <leavemealone@home> wrote:
> > If you are using the form control option buttons then put them inside a
> > group box. All option buttons inside a group box are mutually exclusive.
> > If you are using the ActiveX option buttons then set the Groupname property
> > on each of the option buttons to the same value.
> >
> > Regards,
> > Fred
> >
> > "5elpep" <5el...@gmail.com> wrote in message
> >
> > news:2533323e-fda7-41b0-b9e0-6a70c8bb21aa@u6g2000prc.googlegroups.com...
> >
> >
> >
> > >I need to set up 3 option boxes that are mutually exclusive.
> > > When I click on one option box the other two should be unchecked
> > > etc.etc.
> > > How do I go about doing this - I had a look through the forum but I
> > > can't seem to find a solution.
> >
> > > Thanks- Hide quoted text -
> >
> > - Show quoted text -
>
> Sorry I should have been more specific - I am usin the controls
> toolbox.

--

Dave Peterson

Re: Mutually Exclusive Option Boxes by 5elpep

5elpep
Tue Jul 29 10:32:30 CDT 2008

Cheers Dave & Fred,

I am now trying to control protection on part of the worksheet via one
of my option buttons.
Basically when the option is checked the cells should be unprotected
and when I select one of the other option buttons in the group the
cells should be protected again.

I am using the below code but it oesn't seem to work. It unprotects
and protects the sheet fine but it won't format the cells as
required. Any pointers would be much appreciated.

Private Sub OptionButton1_Click()

If OptionButton1.Value = True Then

ActiveSheet.Unprotect
Range("I22:K35").Select
Selection.Locked = False
Selection.FormulaHidden = False
Selection.Interior.ColorIndex = 39
ActiveSheet.Protect

Else

ActiveSheet.Unprotect
Range("I22:K35").Select
Selection.Locked = True
Selection.FormulaHidden = True
Selection.Interior.ColorIndex = xlNone
ActiveSheet.Protect

End If
End Sub

Re: Mutually Exclusive Option Boxes by Dave

Dave
Tue Jul 29 12:20:05 CDT 2008

I put a couple of optionbuttons from the control toolbox toolbar on my test
worksheet.

I added the code to the worksheet's module.

The code worked fine when I clicked OptionButton1.

But the only time excel sees you click on optionbutton1 is when you change its
value from off to on. You actually turn it off by selecting (clicking on) a
different optionbutton.

So have one procedure for each button:

Option Explicit
Private Sub OptionButton1_Click()
If OptionButton1.Value = True Then
With Me
.Unprotect
With Me.Range("I22:K35")
.Locked = False
.FormulaHidden = False
.Interior.ColorIndex = 39
End With
.Protect
End With
End If
End Sub
Private Sub OptionButton2_Click()
If OptionButton2.Value = True Then
With Me
.Unprotect
With Me.Range("I22:K35")
.Locked = True
.FormulaHidden = True
.Interior.ColorIndex = xlNone
End With
.Protect
End With
End If
End Sub

I don't know what your 3rd optionbutton does.

5elpep wrote:
>
> Cheers Dave & Fred,
>
> I am now trying to control protection on part of the worksheet via one
> of my option buttons.
> Basically when the option is checked the cells should be unprotected
> and when I select one of the other option buttons in the group the
> cells should be protected again.
>
> I am using the below code but it oesn't seem to work. It unprotects
> and protects the sheet fine but it won't format the cells as
> required. Any pointers would be much appreciated.
>
> Private Sub OptionButton1_Click()
>
> If OptionButton1.Value = True Then
>
> ActiveSheet.Unprotect
> Range("I22:K35").Select
> Selection.Locked = False
> Selection.FormulaHidden = False
> Selection.Interior.ColorIndex = 39
> ActiveSheet.Protect
>
> Else
>
> ActiveSheet.Unprotect
> Range("I22:K35").Select
> Selection.Locked = True
> Selection.FormulaHidden = True
> Selection.Interior.ColorIndex = xlNone
> ActiveSheet.Protect
>
> End If
> End Sub

--

Dave Peterson