Multiple choice with radio buttons – Part 1

In this tip we discuss the use of radio buttons with 2 examples.
Example 1:
Multiple choice questions with radio buttons are arranged vertically (1), with the possible answers in the text box next to the button (2).

Open the practice file and go to page 1.
Click on the “Developers” (1) tab in on the “Ribbon” (see Excel Automation Course Lesson 3), click on “Insert” button (2) and select the “Option Button” (3).


The cursor now changes to a cross. Go to the left corner of cell D2 and click your left mouse button, draw a rectangle of the size of cell D2 (1) and release the left mouse button and let it be selected.

We are going to copy this button, first. Click on one of the lines of the button for the cursor to change into a cross, press the Ctrl + Shift keys and a + sign appears, next to the arrow cursor (1). While keeping both the keys pressed, drag the mouse button until the box covers the cell D4 and then release the mouse button but keep the Ctrl + Shift keys pressed (2).

Click the left mouse button and drag it back to cell D6, repeat this operation and, copy the option button to the cells D9, D11, D13, D16, D18 and D20.
(Tip: By dragging only the mouse with the Ctrl key pressed, copy the box, and then press the Ctrl and Shift keys to copy the buttons so that they are aligned under each other.)


We can now activate any radio button by clicking it, but we cannot select more that 1 at a time, but we need to activate 3 of them at a time and this can be done with the help of a “Group Box” which is drawn for every 3 buttons.  This is not a problem but what you create, for eg., a questionnaire with 10 or more questions, then this is a lot of work.
Therefore, we will proceed differently, making sure that first round of 4,5,6,7,8 or 9 is activated, and then press the Ctrl key, select the check boxes 4 to 9 and press Delete.
Press the Ctrl key and click on the three remaining radio buttons, successively, so that they are selected, and then go to the “Developers” tab on the ribbon, click on “Insert” and select “Group Box” (1).

The mouse pointer now changed into a cross, so you can draw the group box (1) around the buttons so that they are completely surrounded by it, and make sure that there is room (2) between the bounding boxes of buttons and the group box.

Why do we need to select the buttons first? This is because we have a better view of the size of the radio buttons to draw the group box.
We make it more appealing, visually, by including the entire question in the group box. Click anywhere on the worksheet, press the Ctrl key, select the group box and increase the size(1) so that the group box encloses the question (2).


Awesome!
You've completed Tip 035 - Part 1
START NEXT LESSON