• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User


  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Radio Button on No Selection

Dear Ninja,

I need help on the excel functions or formulas to radio button disables especially the No selection.

How do you disable after I selected the No radio button from the completed school attributes (reason: not completed education) and it will automatically disable the radio button for the got certificate and interest course attributes to prevent the wrong information.

Please view the upload in excel.

Let me know if there are any queries.

Thank you very much


Dear Ninja,

I tried to copy the coding from other sources and see whether ninja can assist:-
Note: Not familiar the vba coding but tried on the disabled button.

With ActiveSheet

    s = ActiveSheet.Shapes(Application.Caller).Name

    Groups = Filter(Groups, s, 0)

    For Each Op In .OptionButtons

        Op.Enabled = 1


    Select Case s

     Case "Got_Certificate"

            For Each Op In .OptionButtons

                If Op.Name <> s Then Op.Value = 0


            .OptionButtons(s & 1).Value = 1

            'Write your code here

    End Select

    For Each k In Groups

        For i = 1 To 3

            .OptionButtons(k & i).Value = 0

            .OptionButtons(k & i).Enabled = 0



End With

End Sub

Sub Got_Certificate()

Dim b As Object

With ActiveSheet

    If .OptionButtons(1).Value = 1 Then

        For Each b In .OptionButtons

            b.Enabled = 1


        For i = 4 To 9

            .OptionButtons(i).Value = xlOff

            .OptionButtons(i).Enabled = 0


    End If

End With

End Sub


Dear Ninja,

Good evening,

I am using a normal excel to complete the survey on the attributes of:-
Name: [Completed]
Gender: [Completed]
Phone: [Completed]
Address: [Completed]
Email: [Completed]

Ninja, How to solve the radio button when I selected the no radio button from the complete school?
Once I selected the no button, the attributes for Go Certificate and Interest Course are disabled.
Does this vba coding help this matter?

Kindly assist with thanks.


Dear vletm,

Yea, I think only dummies like me is trying to copy here and there till I hit the wall badly for an Excel Ninja.

Thank you for your good ideas which I never taught your simple VBA codes are well understand after I sat there and read your coding for a few hours, trying to understand. It just that I stuck on how to structure it into simple coding. So, I write a few comments that I can understand and the rest is still blurred, which will learn from time to time.

Since your idea is good, especially the no selection that can disable the rest of the attributes, could I ask another 4 additional questions as below:-

1) How to outline the selection box that looks like a green selection button?

2) If I select yes at the Completed School attributes, it shows auto-selected the rest of the attributes. How can I give them the option to select it?
(I have tried another dummy copy from your code, but at the end stuck again.)

If .Range("C11").Interior.ColorIndex = 4 Then _

.Range("C13:D20").Interior.ColorIndex = 4

3) How to create a simple error handling of an idiot like me who doesn't know if I select the no button and I still hit the button for the rest of the attributes?

4) Is the radio button a bit confusing to work out?

Hope to hear from you, Ninja.

Thank you very much:)



Excel Ninja
You used something, which starts with s-letter. That would means hours and hours extra work. I would write about possible sample code.
Many other written codes would take time to figure ... what?
Questions are always welcome ...
1) It have to 'stop' code while do any modifications. ( eg to add Exit Sub to beginning of that code )
... and later have to remember to remove it too.
2) I would use term like "It will show those as You have selected before 'No'".
... or why those should able to do selections, if those cannot effect ...hmm?
3) Before hit something (or someone) should 'think' - is it wise to do something
... if someones challenge is that someone can only 'click-click...' or 'hit-hit...' then there would be more challenges.
Someway same as 'measure twice - cut once' -phrase ...
Of course, there could add eg some kind of routine, that user should verify 'no' ... but soon that would feel bad for user!
4) I checked Your radiobuttons and there were many copy and paste ... somethings ...
and You had idea to disable some selection ... but if I remember, those radiobuttons can be visible ... or not.
Of course, those Yes/No could show 'my way' more like 'option-buttons' ... but I tried to keep my sample - basic.


Dear vletm,
Yeap, all in any letter s that I can think of in doing the small VBA are searching, sacrificing, seeing, and at a snail's gallop it takes many hours if you know based on your experience. "
As for me, still, a long way to go and learn.

Answer for the Sheet One - Horizontal
1) Do you mean the "Exit Sub" at the below of the first line?
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'Exit Sub
2) Yea, I still like how you disabled using the no button. That's a good point. Hmm, how can I refresh the form as a new form so that a new student can select again?
3) New idioms - " Measure twice, cut once". I think I shall put the sentence at the spreadsheet to inform the people who use the survey as a measurement. " Select one of the requirements below" rather than hit-hit and click click for fun. Completed at Sheet one, B10
Note: You should call yourself Excel and English Ninja or E&E Ninja. Great English.
4) The radio button is in the different names of each group but cannot disabled.
I have seen their resources in VBA code but I don't understand at all and copy also wrong.:confused:

Okay, vletm, I have renamed the Sheet One is called Horizontal and the sheet two is called Vertical. Attached file.

In the sheet two - Vertical, could you write your VBA simple code that has all in vertical?
1) Gender - Select Male or Female
2) Reading Category - Select either Classic, Fantasy or comedy
3) Book Name - Select either Samual Classic, Final Fantasy or Laughter the best medicine

I have using your code earlier to put into the second sheet - vertical but stuck again on the row, which no idea what to write next?

Hope to hear from you, E&E Ninja.

Thank you very much. :)



Excel Ninja
These codings would need ...hmm? sitting & coding ... and have to learn to have breaks.

1) Yes
2) I added a button
3) That's old phrase ... and ... there are many variations ... all of those are useful with many cases.
4) With forms, those maybe could also disable, but 'my way' is basic way to do these.

Your: What to write next?
... especially partially copy & past works ... if ... and ... if ... otherwise something else!
... You should try to figure - how would do it ... manually.

Now, You know something ... and ... after five years ... You would figure, how would those work ... or not.