Linking two sets of option button

luc38luc

New Member
Joined
Jan 14, 2005
Messages
29
Hi everyone, you've been great in helping me. I have another issue

I have two sets of option button and I am trying to link them together. For example if you choose in set one button one or two, and in set two button 1 to 6, I want to print a specific area of a specific document

Sub OptionButtonExample()
'unload the form in case it was left in memory
Unload formOptionButtons
'display the list until an item is selected or cancel pressed
Do
formOptionButtons.Show
'check value of bOK that was set by the buttons on the form
If Not bOK Then Exit Sub
'if an item is selected, exit the loop after displaying a message
Select Case True

IF Case formOptionButtons.OptionButton1.Value then 'example
MsgBox "you selected button 2up"


Case formOptionButtons.OptionButton3.Value
MsgBox "you selected button 1 2up"
Exit Do
Case formOptionButtons.OptionButton4.Value
MsgBox "you selected button 2 2up"
Exit Do
Case formOptionButtons.OptionButton5.Value
MsgBox "you selected button 3 2up"
Exit Do
Case formOptionButtons.OptionButton6.Value
MsgBox "you selected button 4 2up"
Exit Do
Case formOptionButtons.OptionButton7.Value
MsgBox "you selected button 5 2up"
Exit Do
Case formOptionButtons.OptionButton8.Value
MsgBox "you selected button 6 2up"
Exit Do

elseif (Case formOptionButtons.OptionButton2.Value) then 'example
MsgBox "you selected button 6up"


Case formOptionButtons.OptionButton1.Value
MsgBox "you selected button 1 6up"
Exit Do
Case formOptionButtons.OptionButton2.Value
MsgBox "you selected button 2 6up"
Exit Do
Case formOptionButtons.OptionButton3.Value
MsgBox "you selected button 3 6up"
Exit Do
Case formOptionButtons.OptionButton4.Value
MsgBox "you selected button 4 6up"
Exit Do
Case formOptionButtons.OptionButton5.Value
MsgBox "you selected button 5 6up"
Exit Do
Case formOptionButtons.OptionButton6.Value
MsgBox "you selected button 6 6up"
Exit Do

Case Else
MsgBox "Vous avez pas choisie toute les champs. Veuillez choisir la sorte de carte et le nombre de copie"
End Select
Loop
'remove the form from memory
Unload formOptionButtons

End Sub

In bold is where I am trying to link both sets of option button. Is there someone who have an idea.
thanks in advance
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
No Taz I don' want to group them. If I choose in the first group of option then some options are offered in the second group.
 
Upvote 0

Forum statistics

Threads
1,207,093
Messages
6,076,544
Members
446,212
Latest member
KJAYPAL200

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top