ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   group 3 optionbuttons and call them (https://www.excelbanter.com/excel-programming/410006-group-3-optionbuttons-call-them.html)

pswanie

group 3 optionbuttons and call them
 
I got six optionbuttons 12,13,14,15,16,17 in a frame. I need a code to check
if the user selected one of 12,13,14 and one of 15,16,17. in the properties
field i named 12,13,14 groupa and 15,16,17 groupb.

so i need a code similair to

if (one of groupa)=true/enable then
if (one of groupb)=true/enable then

run code

else

msgbox "you need to specify department and daypart"
end if


thanx guys
--
Helpful advice on posting to newsgroups here...
http://www.cpearson.com/excel/newposte.htm

DMoney

group 3 optionbuttons and call them
 
I would use a variable to accomplish this

dim groupa as variant
groupa=optionbutton12.value + optionbutton13.value + optionbutton14.value
dim groupb as variant
groupb=optionbutton12.value + optionbutton13.value + optionbutton14.value

if groupa =-1 then .....
else ......
end if



"pswanie" wrote:

I got six optionbuttons 12,13,14,15,16,17 in a frame. I need a code to check
if the user selected one of 12,13,14 and one of 15,16,17. in the properties
field i named 12,13,14 groupa and 15,16,17 groupb.

so i need a code similair to

if (one of groupa)=true/enable then
if (one of groupb)=true/enable then

run code

else

msgbox "you need to specify department and daypart"
end if


thanx guys
--
Helpful advice on posting to newsgroups here...
http://www.cpearson.com/excel/newposte.htm


Dave Peterson

group 3 optionbuttons and call them
 
Without using the frame:

if opt12.value = true _
or opt13.value = true _
or opt14.value = true then
if opt15.value = true _
or opt16.value = true _
or opt17.value = true then
call RunTheCode
else
msgbox "you chose the first group--but not the second"
end if
else
msgbox "you have to choose the first group!"
end if



pswanie wrote:

I got six optionbuttons 12,13,14,15,16,17 in a frame. I need a code to check
if the user selected one of 12,13,14 and one of 15,16,17. in the properties
field i named 12,13,14 groupa and 15,16,17 groupb.

so i need a code similair to

if (one of groupa)=true/enable then
if (one of groupb)=true/enable then

run code

else

msgbox "you need to specify department and daypart"
end if

thanx guys
--
Helpful advice on posting to newsgroups here...
http://www.cpearson.com/excel/newposte.htm


--

Dave Peterson

pswanie

group 3 optionbuttons and call them
 
thanx.. will give that a try.. i did not use that before... how and for what
all can i use it?? seems like usefull feature
--
Helpful advice on posting to newsgroups here...
http://www.cpearson.com/excel/newposte.htm


"pswanie" wrote:

I got six optionbuttons 12,13,14,15,16,17 in a frame. I need a code to check
if the user selected one of 12,13,14 and one of 15,16,17. in the properties
field i named 12,13,14 groupa and 15,16,17 groupb.

so i need a code similair to

if (one of groupa)=true/enable then
if (one of groupb)=true/enable then

run code

else

msgbox "you need to specify department and daypart"
end if


thanx guys
--
Helpful advice on posting to newsgroups here...
http://www.cpearson.com/excel/newposte.htm



All times are GMT +1. The time now is 06:44 PM.

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