ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   more than 2 option buttons on a form (https://www.excelbanter.com/excel-programming/383596-more-than-2-option-buttons-form.html)

Caroline

more than 2 option buttons on a form
 
When I have two option buttons on a form, I define a range as a ControlSource
in the property of the first one, and the TRUE/FALSE of that range allows me
to define which button is chosen.
Can you tell me what I need to do when I have 4 option buttons and the user
is to choose only one at the time (mutually exclusive). How can I track which
one has been chosen on the form.
Any help is greatly appreciated
Thanks
--
caroline

Susan

more than 2 option buttons on a form
 
on the userform insert a FRAME. then move all your option buttons
into the frame. it will automatically group them all together & only
allow one to be chosen.
hth
susan

On Feb 20, 1:45 pm, caroline
wrote:
When I have two option buttons on a form, I define a range as a ControlSource
in the property of the first one, and the TRUE/FALSE of that range allows me
to define which button is chosen.
Can you tell me what I need to do when I have 4 option buttons and the user
is to choose only one at the time (mutually exclusive). How can I track which
one has been chosen on the form.
Any help is greatly appreciated
Thanks
--
caroline




Susan

more than 2 option buttons on a form
 
i forgot to answer part II to your question.......
then in your code you have to have "if" statements which check each
option button to see which one was selected.
susan


On Feb 20, 1:45 pm, caroline
wrote:
When I have two option buttons on a form, I define a range as a ControlSource
in the property of the first one, and the TRUE/FALSE of that range allows me
to define which button is chosen.
Can you tell me what I need to do when I have 4 option buttons and the user
is to choose only one at the time (mutually exclusive). How can I track which
one has been chosen on the form.
Any help is greatly appreciated
Thanks
--
caroline




Caroline

more than 2 option buttons on a form
 
Thanks.
I did not realise that the code could refer directly to the name of the
button:)
If OptionOne Then
if OptionTwo Then
--
caroline


"Susan" wrote:

i forgot to answer part II to your question.......
then in your code you have to have "if" statements which check each
option button to see which one was selected.
susan


On Feb 20, 1:45 pm, caroline
wrote:
When I have two option buttons on a form, I define a range as a ControlSource
in the property of the first one, and the TRUE/FALSE of that range allows me
to define which button is chosen.
Can you tell me what I need to do when I have 4 option buttons and the user
is to choose only one at the time (mutually exclusive). How can I track which
one has been chosen on the form.
Any help is greatly appreciated
Thanks
--
caroline





Tom Ogilvy

more than 2 option buttons on a form
 
while a frame works, it is not required. You can use the group name property
of each option button and put in a common name. It doesn't make any
difference what one word you use as long as it is unique to those 4 option
buttons.

--
Regards,
Tom Ogilvy



"caroline" wrote:

Thanks.
I did not realise that the code could refer directly to the name of the
button:)
If OptionOne Then
if OptionTwo Then
--
caroline


"Susan" wrote:

i forgot to answer part II to your question.......
then in your code you have to have "if" statements which check each
option button to see which one was selected.
susan


On Feb 20, 1:45 pm, caroline
wrote:
When I have two option buttons on a form, I define a range as a ControlSource
in the property of the first one, and the TRUE/FALSE of that range allows me
to define which button is chosen.
Can you tell me what I need to do when I have 4 option buttons and the user
is to choose only one at the time (mutually exclusive). How can I track which
one has been chosen on the form.
Any help is greatly appreciated
Thanks
--
caroline





Susan

more than 2 option buttons on a form
 
Drats! foiled again!
:)
susan

On Feb 20, 2:38 pm, Tom Ogilvy
wrote:
while a frame works, it is not required. You can use the group name property
of each option button and put in a common name. It doesn't make any
difference what one word you use as long as it is unique to those 4 option
buttons.

--
Regards,
Tom Ogilvy



"caroline" wrote:
Thanks.
I did not realise that the code could refer directly to the name of the
button:)
If OptionOne Then
if OptionTwo Then
--
caroline


"Susan" wrote:


i forgot to answer part II to your question.......
then in your code you have to have "if" statements which check each
option button to see which one was selected.
susan


On Feb 20, 1:45 pm, caroline
wrote:
When I have two option buttons on a form, I define a range as a ControlSource
in the property of the first one, and the TRUE/FALSE of that range allows me
to define which button is chosen.
Can you tell me what I need to do when I have 4 option buttons and the user
is to choose only one at the time (mutually exclusive). How can I track which
one has been chosen on the form.
Any help is greatly appreciated
Thanks
--
caroline- Hide quoted text -


- Show quoted text -




Ray

more than 2 option buttons on a form
 
On Feb 20, 4:01 pm, "Susan" wrote:
Drats! foiled again!
:)
susan

On Feb 20, 2:38 pm, Tom Ogilvy
wrote:

while a frame works, it is not required. You can use the group name property
of each option button and put in a common name. It doesn't make any
difference what one word you use as long as it is unique to those 4 option
buttons.


--
Regards,
Tom Ogilvy


"caroline" wrote:
Thanks.
I did not realise that the code could refer directly to the name of the
button:)
If OptionOne Then
if OptionTwo Then
--
caroline


"Susan" wrote:


i forgot to answer part II to your question.......
then in your code you have to have "if" statements which check each
option button to see which one was selected.
susan


On Feb 20, 1:45 pm, caroline
wrote:
When I have two option buttons on a form, I define a range as a ControlSource
in the property of the first one, and the TRUE/FALSE of that range allows me
to define which button is chosen.
Can you tell me what I need to do when I have 4 option buttons and the user
is to choose only one at the time (mutually exclusive). How can I track which
one has been chosen on the form.
Any help is greatly appreciated
Thanks
--
caroline- Hide quoted text -


- Show quoted text -


Good stuff .... but a follow-up question...

Let's say I want to use the 4 option-buttons to choose which graph to
display, with the non-selected graphs being hidden. How would I write
the code to do this? Is it as straight-forward as:
if optionone then
Show graph1
Hide graph2
Hide graph3
Hide graph4

if optiontwo then
Show graph2
Hide graph1
Hide graph3
Hide graph4
and so on...

OR, if there a simpler way to do this?

TIA, Ray


Dave Peterson

more than 2 option buttons on a form
 
I'd hide all 4 of the graphs.

Then use the option buttons to decide which one to show.

Ray wrote:

On Feb 20, 4:01 pm, "Susan" wrote:
Drats! foiled again!
:)
susan

On Feb 20, 2:38 pm, Tom Ogilvy
wrote:

while a frame works, it is not required. You can use the group name property
of each option button and put in a common name. It doesn't make any
difference what one word you use as long as it is unique to those 4 option
buttons.


--
Regards,
Tom Ogilvy


"caroline" wrote:
Thanks.
I did not realise that the code could refer directly to the name of the
button:)
If OptionOne Then
if OptionTwo Then
--
caroline


"Susan" wrote:


i forgot to answer part II to your question.......
then in your code you have to have "if" statements which check each
option button to see which one was selected.
susan


On Feb 20, 1:45 pm, caroline
wrote:
When I have two option buttons on a form, I define a range as a ControlSource
in the property of the first one, and the TRUE/FALSE of that range allows me
to define which button is chosen.
Can you tell me what I need to do when I have 4 option buttons and the user
is to choose only one at the time (mutually exclusive). How can I track which
one has been chosen on the form.
Any help is greatly appreciated
Thanks
--
caroline- Hide quoted text -


- Show quoted text -


Good stuff .... but a follow-up question...

Let's say I want to use the 4 option-buttons to choose which graph to
display, with the non-selected graphs being hidden. How would I write
the code to do this? Is it as straight-forward as:
if optionone then
Show graph1
Hide graph2
Hide graph3
Hide graph4

if optiontwo then
Show graph2
Hide graph1
Hide graph3
Hide graph4
and so on...

OR, if there a simpler way to do this?

TIA, Ray


--

Dave Peterson

Ray

more than 2 option buttons on a form
 
On Feb 25, 9:13 pm, Dave Peterson wrote:
I'd hide all 4 of the graphs.

Then use the option buttons to decide which one to show.



Ray wrote:

On Feb 20, 4:01 pm, "Susan" wrote:
Drats! foiled again!
:)
susan


On Feb 20, 2:38 pm, Tom Ogilvy
wrote:


while a frame works, it is not required. You can use the group name property
of each option button and put in a common name. It doesn't make any
difference what one word you use as long as it is unique to those 4 option
buttons.


--
Regards,
Tom Ogilvy


"caroline" wrote:
Thanks.
I did not realise that the code could refer directly to the name of the
button:)
If OptionOne Then
if OptionTwo Then
--
caroline


"Susan" wrote:


i forgot to answer part II to your question.......
then in your code you have to have "if" statements which check each
option button to see which one was selected.
susan


On Feb 20, 1:45 pm, caroline
wrote:
When I have two option buttons on a form, I define a range as a ControlSource
in the property of the first one, and the TRUE/FALSE of that range allows me
to define which button is chosen.
Can you tell me what I need to do when I have 4 option buttons and the user
is to choose only one at the time (mutually exclusive). How can I track which
one has been chosen on the form.
Any help is greatly appreciated
Thanks
--
caroline- Hide quoted text -


- Show quoted text -


Good stuff .... but a follow-up question...


Let's say I want to use the 4 option-buttons to choose which graph to
display, with the non-selected graphs being hidden. How would I write
the code to do this? Is it as straight-forward as:
if optionone then
Show graph1
Hide graph2
Hide graph3
Hide graph4


if optiontwo then
Show graph2
Hide graph1
Hide graph3
Hide graph4
and so on...


OR, if there a simpler way to do this?


TIA, Ray


--

Dave Peterson


Is there some kind of parameter I can set on each chart to hide them
by default? and if so, when the user changes graphs, would the
previously unhidden graph become hidden again automatically?


Dave Peterson

more than 2 option buttons on a form
 
No setting that I know of.

I'd hide all the charts first:

Hide graph1
Hide graph2
Hide graph3
Hide graph4

'and you'd still have to show

if optionone then
Show graph1
elseif optiontwo then
....



Ray wrote:

<<snipped
Is there some kind of parameter I can set on each chart to hide them
by default? and if so, when the user changes graphs, would the
previously unhidden graph become hidden again automatically?


--

Dave Peterson


All times are GMT +1. The time now is 01:11 AM.

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