Add a group box or frame control to a worksheet

You can use a group box or a frame control to group related controls (such as option buttons, check boxes, or closely related contents) into one visual unit.

What do you want to do?



Learn about group boxes and frame controls

Group boxes and frame controls are rectangular objects with optional labels. Use a group box or a frame control to visually organize related items on a form. For example, in a customer order application, group the name, address, and account number of a customer. Or in an order form, group a list of available items.


Group box (Form control)

Example of a Form group box control

Frame control (ActiveX control)

Example of an ActiveX group box control


Top of Page Top of Page

Add a group box (Form control)

  1. If the Developer tab is not available, display it.

ShowDisplay the Developer tab

  1. Click the Microsoft Office Button Button image, and then click Excel Options.
  1. In the Popular category, under Top options for working with Excel, select the Show Developer tab in the Ribbon check box, and then click OK.

 Note   The Ribbon is a component of the Microsoft Office Fluent user interface.

  1. On the Developer tab, in the Controls group, click Insert, and then under Form Controls, click Group box Button image.

Controls group

  1. Click the worksheet location where you want the upper-left corner of the group box to appear.
  2. Place related controls inside the boundary of the Group box.

For example:

  • Check boxes, such as a list of related products for purchase.
  • Labels and text boxes, such as name and address information.
  • Option buttons that indicate a set of mutually exclusive choices, such as Small, Medium, or Large.
  1. To specify the control properties, right-click the control, and then click Format Control.

Top of Page Top of Page

Add a frame control (ActiveX control)

  1. If the Developer tab is not available, display it.

ShowDisplay the Developer tab

  1. Click the Microsoft Office Button Button image, and then click Excel Options.
  1. In the Popular category, under Top options for working with Excel, select the Show Developer tab in the Ribbon check box, and then click OK.

 Note   The Ribbon is a component of the Microsoft Office Fluent user interface.

  1. On the Developer tab, in the Controls group, click Insert, and then under ActiveX Controls, click More Controls Button image.

Controls group

  1. In the More Controls dialog box, select Microsoft Forms 2.0 Frame from the list of available controls on your computer.
  2. Click the worksheet location where you want the upper-left corner of the frame control to appear.
  3. To edit the ActiveX control, make sure that you are in design mode. On the Developer tab, in the Controls group, turn on Design Mode Button image.
  4. To specify the control properties, on the Developer tab, in the Controls group, click Properties Edit code button.

 Tip   You can also right-click the control, and then click Properties.

The Properties dialog box appears. For detailed information about each property, select the property, and then press F1 to display a Visual Basic Help (Visual Basic Help: To get Help for Visual Basic, point to Macro on the Tools menu, and then click Visual Basic Editor. On the Help menu, click Microsoft Visual Basic Help.) topic. You can also type the property name in the Visual Basic Help Search box. The following section summarizes the properties that are available.

Summary of properties by functional categories

If you want to specify Use this property
General:  
Whether the control is loaded when the workbook is opened. (Ignored for ActiveX controls.) AutoLoad (Excel)
Whether the control can receive the focus and respond to user-generated events. Enabled (Form)
Whether the control can be edited. Locked (Form)
The name of the control. Name (Form)
The way the control is attached to the cells below it (free floating, move but do not size, or move and size). Placement (Excel)
Whether the control can be printed. PrintObject (Excel)
Whether the control is visible or hidden. Visible (Form)
Text:  
Font attributes (bold, italic, size, strikethrough, underline, and weight). Bold, Italic, Size, StrikeThrough, Underline, Weight (Form)
Descriptive text on the control that identifies or describes it. Caption (Form)
Size and position:  
The height or width in points. Height, Width (Form)
The distance between the control and the left or top edge of the worksheet. Left, Top (Form)
Formatting:  
The background color. BackColor (Form)
The color of the border. BorderColor (Form)
The foreground color. ForeColor (Form)
Whether the control has a shadow. Shadow (Excel)
The visual appearance of the border (flat, raised, sunken, etched, or bump). SpecialEffect (Form)
Image:  
The bitmap to display in the control. Picture (Form)
The location of a background picture (top left, top right, center, and so on). PictureAlignment (Form)
How to display the background picture on the control (crop, stretch, or zoom). PictureSizeMode (Form)
Whether you want to tile multiple copies of the picture in the control. PictureTiling (Form)
Keyboard and mouse:  
A custom mouse icon. MouseIcon (Form)
The type of pointer that is displayed when the user positions the mouse over a particular object (for example, standard, arrow, or I-beam). MousePointer (Form)
Specific to frame:  
The type of border used, either a single-line or none. BorderStyle (Form)
Whether the control has vertical scroll bars, horizontal scroll bars, or both. ScrollBars (Form)
The action to take when the user leaves the last control on a frame or page (all forms or current form). Cycle (Form)
Whether scroll bars remain visible when not required. KeepScrollBarsVisible (Form)
The height or width, in points, of the total area that can be viewed by moving the scroll bars. ScrollHeight, ScrollWidth (Form)
The distance, in points, of the left or top edge of the logical form from the left or top edge of the frame. ScrollLeft, ScrollTop (Form)
How much to change the size of an image in the frame. Zoom (Form)

 Notes 

  • If you plan to use the frame control frequently, add it to a "Saved controls" worksheet, and then save the worksheet for reuse. The next time that you need the frame control, open that worksheet, and then copy the frame control to the worksheet form that you are editing.
  • All option buttons in a frame are mutually exclusive by default.
  • You can also use a toggle button inside a frame to select one or more items from a related group. For example, you can create an order form that contains a list of available items with a toggle button preceding each item.

Top of Page Top of Page

 
 
Applies to:
Excel 2007