Hi,
I have two sets of option buttons in my excel sheet. One set will have options captioned as "One", "Two" and "Three". By clicking any of these my excel sheet cell "D2" will contain a no. accordingly. Say, if I click the option "Two", my excell sheet "D2" will be filled with a value of "2".
Similarly, I have another set of option buttons in the same excel sheet that lists "Eight" and "Nine". When clicked "Eight", it will retun value "8" to another cell, say "E2".
I used the following VB program for that:
Sub obn_Click()
' for the first three options "One", "Two" and "Three"
Select Case ActiveSheet.OptionButtons(Application.Caller).Caption
Case "Zero": [D2].Value = 0
Case "One": [D2].Value = 1
Case "Two": [D2].Value = 2
End Select
End Sub
Sub OptionButton4_Click()
' for the two cases "Eight" and "Nine"
Select Case ActiveSheet.OptionButtons(Application.Caller).Caption
Case "Eight": [E2].Value = 8
Case "Nine": [E2].Value = 9
End Select
End Sub
Here come the questions.
In my excel sheet, first I select "One" from the first set ("One", Two" and "Three"). Thus, I get value 1 in "D2". Now, when I click "Eight" from the second set of options ("Eight" and "Nine"), the option "One" from first set is deselected and then "Eight" is selected. Consoling part is "D2" is still filled with 1 and "E2" is with 8. But I need one of the options in first set is still retained with the selected, when I choose from the second set.
Secondly, is it possible to use the program in a way to fill "D2" with word "One" instead of number "1", when clicked the option "One"?
Thanks for your help in advance,
Udhay
I have two sets of option buttons in my excel sheet. One set will have options captioned as "One", "Two" and "Three". By clicking any of these my excel sheet cell "D2" will contain a no. accordingly. Say, if I click the option "Two", my excell sheet "D2" will be filled with a value of "2".
Similarly, I have another set of option buttons in the same excel sheet that lists "Eight" and "Nine". When clicked "Eight", it will retun value "8" to another cell, say "E2".
I used the following VB program for that:
Sub obn_Click()
' for the first three options "One", "Two" and "Three"
Select Case ActiveSheet.OptionButtons(Application.Caller).Caption
Case "Zero": [D2].Value = 0
Case "One": [D2].Value = 1
Case "Two": [D2].Value = 2
End Select
End Sub
Sub OptionButton4_Click()
' for the two cases "Eight" and "Nine"
Select Case ActiveSheet.OptionButtons(Application.Caller).Caption
Case "Eight": [E2].Value = 8
Case "Nine": [E2].Value = 9
End Select
End Sub
Here come the questions.
In my excel sheet, first I select "One" from the first set ("One", Two" and "Three"). Thus, I get value 1 in "D2". Now, when I click "Eight" from the second set of options ("Eight" and "Nine"), the option "One" from first set is deselected and then "Eight" is selected. Consoling part is "D2" is still filled with 1 and "E2" is with 8. But I need one of the options in first set is still retained with the selected, when I choose from the second set.
Secondly, is it possible to use the program in a way to fill "D2" with word "One" instead of number "1", when clicked the option "One"?
Thanks for your help in advance,
Udhay