Most Valuable Professional


View Jan Karel Pieterse's profile on LinkedIn subscribe to rss feed
Subscribe in a reader

Subscribe to our mailing list

* indicates required

File crashes Excel!!

Save my workbook!
The best tool for salvaging problematic workbooks.

Trainings

Excel VBA Masterclass (English)
Excel VBA for Financials (Dutch)

Third party tools

Speed up your file

FastExcel
The best tool to optimise your Excel model!

Repair your file

Stellar Phoenix Excel Repair
Best tool to repair corrupt Excel sheets and objects
Home > English site > Articles > Controls > Descriptions (2)
Deze pagina in het Nederlands

Using controls on worksheets

Detailed description of the controls (2)

CheckBox

Typically, a checkbox control is used to enable the user to turn something on or off, or to answer a yes/no question. The checkbox always stands on its own, allowing multiple options to be selected (checked) at the same time.

OptionButton

The option button is very similar to the check box, but only allows mutually exclusive choices to be made; in a set of option buttons, only one option can be "checked". If you take no specific action then all option buttons on one sheet will be treated as one single group. It is possible to have multiple groups on a sheet. The method to achieve this differs between the two sets of option buttons.

The method to tie an option button to a cell differs between the two types too.

Forms option button

To group option buttons from the forms toolbar, first draw frames on your sheet. Then draw the option buttons INSIDE the frame:

Keuzerondjes in groepsvak

Fig 8 : Two frames with option buttons.

Option buttons from the forms toolbar share their linked cell. The value returned to the cell is the index number of the selected option. Note that the index will match the order in which you created the option buttons.

To select a control from the forms toolbar (for example to be able to move the control), either right-click the control or control+click it. To select multiple controls to change their properties in one go, hold control while clicking them.

Group controls you want to keep together, for example those within a frame, by control+clicking them in turn and then right-clicking on one of their edges and selecting "Grouping", "Group".

Control toolbox option button (ActiveX)

The option button from the Control toolbox toolbar (ActiveX) has a special property to set up which work together, called the Groupname property:

Groupname instellen

Fig 9: Groupname property of the ActiveX OptionButton control.

If you do not change this property, all option buttons on a sheet work together as a single group.

ActiveX option buttons all have their own linked cell, which will receive the checked state of their parents as a True/False value.

TIP: You can get at the properties window of the controls by right-clicking a control and selecting "Properties". You can also click the appropriate button on the Control Toolbox toolbar. In Excel 2007 and up, you'll find that button on the Developer tab, within the Controls group.


 


Comments

All comments about this page:


Comment by: James Wagner (1/6/2012 8:52:45 AM)

I am trying to link a checkbox to multiple sheets in a workbook so that checking the checkbox on sheet one, checks the corresponding box on sheets 2, 3, and so on. Is this even possible?

Thank you

 


Comment by: Jan Karel Pieterse (1/9/2012 1:05:45 AM)

Hi James,

If you make sure all checkboxes share the same linked cell, they should work as a team.

 


Have a question, comment or suggestion? Then please use this form.

If your question is not directly related to this web page, but rather a more general "How do I do this" Excel question, then I advise you to ask your question here: www.eileenslounge.com.

Please enter your name (required):

Your e-mail address (optional but if you want me to respond it helps!; will not be shown, nor be used to send you unsolicited information):

Your request or comment:

To post VBA code in your comment, use [VB] tags, like this: [VB]Code goes here[/VB].