LikeOffice    Excel Help

EXCEL Utility
Customized Ribbon

- Compare worksheets
- Database analysis
- Stock to your Excel
- Password recovery
- and more...


Excel Formula
List of Excel
Formula examples

 
Excel Question
Ask us an Excel Question


 

This page presents how to work with Microsoft Excel 2007 features and its redesigned interface. You may also visit our Excel Question page.

 

   Add a button or command button to a worksheet

   Add a check box, option button, or toggle button to a worksheet

   Add a group box or frame control to a worksheet

   Add a label or text box to a worksheet

   Add a list box or combo box to a worksheet

   Add a scroll bar or spin button to a worksheet

   Add an image control to a worksheet

   Add or edit a macro for a control on a worksheet

   Add or register an ActiveX control

   Add, edit, find, and delete rows by using a data form

   Delete controls on a worksheet

   Edit text in a control on a worksheet

   Group, copy, move, or align controls on a worksheet

   Overview of  forms, Form controls, and ActiveX controls on a worksheet

   Position and size a control with its underlying cell on a worksheet

   Print a control on a worksheet

   Protect controls and linked cells on a worksheet

   Resize or format a control on a worksheet

   Select or deselect controls on a worksheet

   What can I do if I can't see or edit a cell because a control or object covers it?

   Why are form-related commands or controls on the ribbon disabled?

   Why can't I select form and ActiveX controls?


Add a button or command button to a worksheet

You can use a button (a Form control) or a command button (an ActiveX control) to run a macro that performs an action when a user clicks it.

What do you want to do?

Learn about the button and the command button

Add a button (Form control)

Add a command button (ActiveX control)

Learn about the button and the command button

Both a Form control button and an ActiveX control command button are also referred to as a push button. You might use a button or a command button to automate the printing of a worksheet, the filtering of data, or the calculation of numbers. In general, a Form control button and an ActiveX control command button are similar in appearance and function. However, they do have a few differences, which are explained in the following sections.

Button (Form control)

Command button (ActiveX control)

 

 Top of Page

Add a button (Form control)

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

Display the Developer tab

    1. Click the Microsoft Office Button , and then click Excel Options.
    2. 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 Button .

  1. Click the worksheet location where you want the upper-left corner of the button to appear.
  2. Assign a macro (macro: An action or a set of actions that you can use to automate tasks. Macros are recorded in the Visual Basic for Applications programming language.) to the button.

For more information about how to create and edit macros, see the Help section, Macros.

  1. To specify the control properties of the button, right-click the button, and then click Format Control.

 Top of Page

Add a command button (ActiveX control)

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

Display the Developer tab

    1. Click the Microsoft Office Button , and then click Excel Options.
    2. 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 Command Button .

  1. Click the worksheet location where you want the upper-left corner of the command button to appear.
  2. 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 .
  3. To specify the control properties of the command button, on the Developer tab, in the Controls group, click Properties .

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

 Note    Before you click Properties, make sure that the object for which you want to examine or change properties is already selected.

The Properties 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 table summarizes the properties that are available.

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 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)

   
 



   
 

Whether the contents of the control automatically wrap at the end of a line.

WordWrap (Form)

   
 



   
 



   
 

Size and Position:

 

   
 

Whether the size of the control automatically adjusts to display all the contents.

AutoSize (Form)

   
 



   
 

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 background style (transparent or opaque).

BackStyle (Form)

   
 



   
 

The foreground color.

ForeColor (Form)

   
 



   
 

Whether the control has a shadow.

Shadow (Excel)

   
 



   
 



   
 

Image:

 

   
 

The bitmap to display in the control.

Picture (Form)

   
 



   
 

The location of the picture relative to its caption (left, top, right, and so on).

PicturePosition (Form)

   
 



   
 



   
 

Keyboard and Mouse:

 

   
 

The shortcut key for the control.

Accelerator (Form)

   
 



   
 

A custom mouse icon.

MouseIcon (Form)

   
 



   
 

The type of pointer that is displayed when the user positions the mouse over a particular object (standard, arrow, I-beam, and so on).

MousePointer (Form)

   
 



   
 

Whether the control takes the focus when clicked.

TakeFocusOnClick (Form)

   
 



   

 Top of Page


See Also

 

 

Excel > Forms

Add a check box, option button, or toggle button to a worksheet

Excel 2007

You can use a check box, option button, or toggle button to indicate "either/or" (or binary) choices.

What do you want to do?

Learn about check boxes, option buttons, and toggle buttons

Add a check box (Form control)

Add a check box (ActiveX control)

Add an option button (Form control)

Add an option button (ActiveX control)

Add a toggle button (ActiveX control)

Learn about check boxes, option buttons, and toggle buttons

Check box  Turns on or off a value that indicates an opposite and unambiguous choice. You can select more than one check box at a time on a worksheet or in a group box. For example, you can use a check box to create an order form that contains a list of available items or in an inventory tracking application to show whether an item has been discontinued.

Check box (Form control)

Check box (ActiveX control)

Option button  Allows a single choice from a limited set of mutually exclusive choices. An option button (or radio button) is usually contained in a group box or frame. For example, you can use an option button on an order form so that a user can select one of a range of sizes, such as small, medium, large, or extra large. Or you can use it for a choice of shipping options, such as ground, express, or overnight.

Option button (Form control)

Option button (ActiveX control)

Toggle button  Indicates a state, such as Yes/No, or a mode, such as On/Off. The button alternates between an enabled and disabled state when it is clicked. For example, you can use a toggle button to switch between design mode and edit mode, or as an alternative to a check box.

 Note    The toggle button is not available as a Form control, only as an ActiveX control.

Toggle button (ActiveX control)

 

 Top of Page

Add a check box (Form control)

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

Display the Developer tab

    1. Click the Microsoft Office Button , and then click Excel Options.
    2. 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 Check box .

  1. Click the worksheet location where you want the upper-left corner of the control to appear.
  2. On the Developer tab, in the Controls group, click Properties .

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

To specify the control properties, do the following:

    1. Under Value, specify the initial state of the check box by doing one of the following:
      • To display a check box that is filled with a check mark, click Checked. A check mark indicates that the check box is selected.
      • To display a check box that is cleared, click Unchecked.
      • To display a check box that is filled with shading, click Mixed. Shading indicates a combination of selected and cleared states; for example, when there is a multiple selection.
    2. In the Cell link box, enter a cell reference that contains the current state of the check box:
      • When the check box is selected, the linked cell returns a TRUE value.
      • When the check box is cleared, the linked cell returns a FALSE value.

 Note    When the linked cell is empty, Microsoft Office Excel interprets the check box state as FALSE.

      • If the check box state is mixed, the linked cell returns a #N/A error value.

Use the returned value in a formula to respond to the current state of the check box.

For example, a travel survey form contains two check boxes labeled Europe and Australia in a Places traveled group box. These two check boxes are linked to cells C1 (for Europe) and C2 (for Australia).

When a user selects the Europe check box, the following formula in cell D1 evaluates to "Traveled in Europe":

=IF(C1=TRUE,"Traveled in Europe","Never traveled in Europe")

When a user clears the Australia check box, the following formula in cell D2 evaluates to "Never traveled in Australia":

=IF(C2=TRUE,"Traveled in Australia","Never traveled in Australia")

If you have three states to evaluate (Checked, Unchecked, and Mixed) in the same group of options, you can use the CHOOSE or LOOKUP functions similarly.

 Note    The size of the check box inside the control and its distance from its associated cannot be adjusted

 Top of Page

Add a check box (ActiveX control)

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

Display the Developer tab

    1. Click the Microsoft Office Button , and then click Excel Options.
    2. 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 Check Box .

  1. Click the worksheet location where you want the upper-left corner of the check box to appear.
  2. 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 .
  3. To specify the control properties, on the Developer tab, in the Controls group, click Properties .

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:

 

   
 

The position of the control relative to its caption (left or right).

Alignment (Form)

   
 

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)

   
 

How text is aligned in the control (left, center, or right).

TextAlign (Form)

   
 

Whether the contents of the control automatically wrap at the end of a line.

WordWrap (Form)

   
 

Data and binding:

 

   
 

The range that is linked to the control's value.

LinkedCell (Excel)

   
 

The content or state of the control.

Value (Form)

   
 

Size and position:

 

   
 

Whether the size of the control automatically adjusts to display all the contents.

AutoSize (Form)

   
 

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 background style (transparent or opaque).

BackStyle (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 the picture relative to its caption (left, top, right, and so on).

PicturePosition (Form)

   
 

Keyboard and mouse:

 

   
 

The shortcut key for the control.

Accelerator (Form)

   
 

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 check box:

 

   
 

A group of mutually exclusive option buttons.

GroupName (Form)

   
 

Whether a user can specify the Null state for the control from the user interface.

TripleState (Form)

   

 Note    The size of the check box inside the control and its distance from its associated text cannot be adjusted.

 Top of Page

Add an option button (Form control)

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

Display the Developer tab

    1. Click the Microsoft Office Button , and then click Excel Options.
    2. 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 Option button .

  1. Click the worksheet location where you want the upper-left corner of the option button to appear.
  2. On the Developer tab, in the Controls group, click Properties .

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

To set the control properties, do the following:

    1. Under Value, specify the initial state of the option button by doing one of the following:
      • To display an option button that is selected, click Checked.
      • To display an option button that is cleared, click Unchecked.
    2. In the Cell link box, enter a cell reference that contains the current state of the option button.

The linked cell returns the number of the selected option button in the group of options. Use the same linked cell for all options in a group. The first option button returns a 1, the second option button returns a 2, and so on. If you have two or more option groups on the same worksheet, use a different linked cell for each option group.

Use the returned number in a formula to respond to the selected option.

For example, a personnel form, with a Job type group box, contains two option buttons labeled Full-time and Part-time linked to cell C1. After a user selects one of the two options, the following formula in cell D1 evaluates to "Full-time" if the first option button is selected or "Part-time" if the second option button is selected.

=IF(C1=1,"Full-time","Part-time")

If you have three or more options to evaluate in the same group of options, you can use the CHOOSE or LOOKUP functions in a similar manner.

 Notes 

    1. You can also edit the control properties by selecting the control, and then by clicking Control Properties on the Forms toolbar.
    2. The size of the option button inside the control and its distance from its associated text cannot be adjusted.

 Note    To see an example of option buttons that are used in an Excel template, see the help topic, Electoral College calculator.

 Top of Page

Add an option button (ActiveX control)

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

Display the Developer tab

    1. Click the Microsoft Office Button , and then click Excel Options.
    2. 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 Option Button .

  1. Click the worksheet location where you want the upper-left corner of the option button to appear.
  2. 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 .
  3. To set the control properties, on the Developer tab, in the Controls group, click Properties .

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)

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 edited.

Locked (Form)

Whether the control can be printed.

PrintObject (Excel)

Whether the control can receive focus and respond to user-generated events.

Enabled (Form)

Whether the control is visible or hidden.

Visible (Form)

Text:

 

Descriptive text on the control that identifies or describes it.

Caption (Form)

Font attributes (bold, italic, size, strikethrough, underline, and weight).

Bold, Italic, Size, StrikeThrough, Underline, Weight (Form)

How text is aligned in the control (left, center, or right).

TextAlign (Form)

The position of the control relative to its caption (left or right).

Alignment (Form)

Whether the contents of the control automatically wrap at the end of a line.

WordWrap (Form)

Data and binding:

 

The content or state of the control.

Value (Form)

The range linked to the control's value.

LinkedCell (Excel)

Size and position:

 

The distance between the control and the left or top edge of the worksheet.

Left, Top (Form)

The height or width in points.

Height, Width (Form)

Whether the size of the control automatically adjusts to display all the contents.

AutoSize (Form)

Formatting:

 

The background color.

BackColor (Form)

The background style (transparent or opaque).

BackStyle (Form)

The foreground color.

ForeColor (Form)

The visual appearance of the border (flat, raised, sunken, etched, or bump).

SpecialEffect (Form)

Whether the control has a shadow.

Shadow (Excel)

Image:

 

The bitmap to display in the control.

Picture (Form)

The location of the picture relative to its caption (left, top, right, and so on).

PicturePosition (Form)

Keyboard and mouse:

 

A custom mouse icon.

MouseIcon (Form)

The shortcut key for the control.

Accelerator (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 option button:

 

A group of mutually exclusive option buttons.

GroupName (Form)

Whether a user can specify the Null state for the control from the user interface.

TripleState (Form)

 Note    The size of the option button inside the control and its distance from its associated text cannot be adjusted.

 Top of Page

Add a Toggle button (ActiveX control)

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

Display the Developer tab

    1. Click the Microsoft Office Button , and then click Excel Options.
    2. 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 Toggle Button .

  1. Click the worksheet location where you want the upper-left corner of the toggle button to appear.
  2. 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 .
  3. To set the control properties, on the Developer tab, in the Controls group, click Properties .

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

The Properties dialog box is displayed. 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.

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 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 can receive focus and respond to user-generated events.

Enabled (Form)

Whether the control is visible or hidden.

Visible (Form)

Text:

 

Descriptive text on the control that identifies or describes it.

Caption (Form)

How text is aligned in the control (left, center, or right).

TextAlign (Form)

Whether the contents of the control automatically wrap at the end of a line.

WordWrap (Form)

Data and Binding:

 

The range linked to the control's value.

LinkedCell (Excel)

The content or state of the control.

Value (Form)

Size and Position:

 

Whether the size of the control automatically adjusts to display all the contents.

AutoSize (Form)

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 background style (transparent or opaque).

BackStyle (Form)

The foreground color.

ForeColor (Form)

Whether the control has a shadow.

Shadow (Excel)

Image:

 

The bitmap to display in the control.

Picture (Form)

The location of the picture relative to its caption (left, top, right, and so on).

PicturePosition (Form)

Keyboard and Mouse:

 

The shortcut key for the control.

Accelerator (Form)

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 Toggle Button:

 

Whether a user can specify the Null state for the control from the user interface.

TripleState (Form)

 Top of Page


See Also

 

 

Excel > Forms

Add a group box or frame control to a worksheet

Excel 2007

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

Add a group box (Form control)

Add a Frame control (ActiveX control)

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)

Frame control (ActiveX control)

 

 Top of Page

Add a group box (Form control)

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

Display the Developer tab

    1. Click the Microsoft Office Button , and then click Excel Options.
    2. 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 .

  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:

    1. Check boxes, such as a list of related products for purchase.
    2. Labels and text boxes, such as name and address information.
    3. 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

Add a frame control (ActiveX control)

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

Display the Developer tab

    1. Click the Microsoft Office Button , and then click Excel Options.
    2. 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 .

  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 .
  4. To specify the control properties, on the Developer tab, in the Controls group, click Properties .

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


See Also

 

 

Excel > Forms

Add a label or text box to a worksheet

Excel 2007

You use a label and a text box together for basic data entry.

What do you want to do?

Learn about labels and text boxes

Add a label (Form control)

Add a label (ActiveX control)

Add a text box (ActiveX control)

Learn about labels and text boxes

A label is text that identifies the purpose of a cell or text box or that displays descriptive text, such as titles, captions, or brief instructions. In addition, a label can display a descriptive picture. Use a label for flexible placement of instructions, to emphasize text, and when merged cells or a specific cell location is not a practical solution.

A text box is a rectangular box in which you can view, enter, or edit text or data that is bound to a cell. A text box can also be a static text field that presents read-only information. Use a text box as an alternative to entering text in a cell, when you want to display an object that floats freely. You can also use a text box to display or view text that is independent of row and column boundaries, preserving the layout of a grid or table of data on the worksheet.

Label (Form control)

Label (ActiveX control)

Text Box (ActiveX control)

 

 Top of Page

Add a label (Form control)

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

Display the Developer tab

    1. Click the Microsoft Office Button , and then click Excel Options.
    2. 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 Label .

  1. Click the worksheet location where you want the upper-left corner of the label to appear.
  2. To specify the control properties, right-click the control, and then click Format Control.

 Top of Page

Add a label (ActiveX control)

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

Display the Developer tab

    1. Click the Microsoft Office Button , and then click Excel Options.
    2. 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 Label .

  1. Click the worksheet location where you want the upper-left corner of the label to appear.
  2. 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 .
  3. Click the worksheet location where you want the upper-left corner of the label to appear.
  4. To specify the control properties, on the Developer tab, in the Controls group, click Properties .

Tip  You can also right-click the label, 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)

     
 

How text is aligned in the control (left, center, or right).

TextAlign (Form)

     
 

Whether the contents of the control automatically wrap at the end of a line.

WordWrap (Form)

     
 

Size and position:

 

     
 

Whether the size of the control automatically adjusts to display all contents.

AutoSize (Form)

     
 

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 background style (transparent or opaque).

BackStyle (Form)

     
 

The color of the border.

BorderColor (Form)

     
 

The type of border (none or single-line).

BorderStyle (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 the picture relative to its caption (left, top, right, and so on).

PicturePosition (Form)

     
 

Keyboard and mouse:

 

     
 

The shortcut key for the control.

Accelerator (Form)

     
 

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)

     

 Top of Page

Add a text box (ActiveX control)

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

Display the Developer tab

    1. Click the Microsoft Office Button , and then click Excel Options.
    2. 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 Text Box .

  1. Click the worksheet location where you want the upper-left corner of the text box to appear.
  2. 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 .
  3. To specify the control properties, on the Developer tab, in the Controls group, click Properties .

Tip  You can also right-click the text box, 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:

 

Whether a word or a character is the basic unit used to extend a selection.

AutoWordSelect (Form)

Font attributes (bold, italic, size, strikethrough, underline, and weight).

Bold, Italic, Size, StrikeThrough, Underline, Weight (Form)

Whether selected text remains highlighted when the control does not have the focus.

HideSelection (Form)

The default run time mode of the Input Method Editor (IME).

IMEMode (Form)

Whether the size of the control adjusts to display full or partial lines of text.

IntegralHeight (Form)

The maximum number of characters a user can enter.

MaxLength (Form)

Whether the control supports multiple lines of text.

MultiLine (Form)

Placeholder characters, such as an asterisk (*), to be displayed instead of actual characters.

PasswordChar (Form)

Whether the user can select a line of text by clicking to the left of the text.

SelectionMargin (Form)

The text in the control.

Text (Form)

How text is aligned in the control (left, center, or right).

TextAlign (Form)

Whether the contents of the control automatically wrap at the end of a line.

WordWrap (Form)

Data and binding:

 

The range that is linked to the control's value.

LinkedCell (Excel)

The content or state of the control.

Value (Form)

Size and position:

 

Whether the size of the control automatically adjusts to display all the contents.

AutoSize (Form)

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 background style (transparent or opaque).

BackStyle (Form)

The color of the border.

BorderColor (Form)

The type of border (none or a single-line).

BorderStyle (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)

Whether an automatic tab occurs when a user enters the maximum allowable characters into the control.

AutoTab (Form)

Keyboard and mouse:

 

Whether drag-and-drop is enabled.

DragBehavior (Form)

The selection behavior when entering the control (select all or do not select).

EnterFieldBehavior (Form)

The effect of pressing ENTER (create a new line or move focus).

EnterKeyBehavior (Form)

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)

Whether tabs are allowed in the edit region.

TabKeyBehavior (Form)

Specific to Text Box:

 

Whether the control has vertical scroll bars, horizontal scroll bars, or both.

ScrollBars (Form)

 Notes 

  • To create a text box with a set of placeholder characters that accepts a password, use the PasswordChar property. Make sure that you protect the linked cell or other location in which the text is stored.

Security  

Use strong passwords that combine uppercase and lowercase letters, numbers, and symbols. Weak passwords don't mix these elements. Strong password: Y6dh!et5. Weak password: House27. Passwords should be 8 or more characters in length. A pass phrase that uses 14 or more characters is better. For more information, see Help protect your personal information with strong passwords.

It is critical that you remember your password. If you forget your password, Microsoft cannot retrieve it. Store the passwords that you write down in a secure place away from the information that they help protect.

  • To create a scrolling, multiple-line text box with horizontal and vertical scroll bars, set MultiLine to True, AutoSize and WordWrap to False, ScrollBars to 3, and LinkedCell to the cell address (such as D1) that you want to contain the text. To enter a new line, the user must press either CTRL+ENTER or SHIFT+ENTER, which generates a special character that is stored in the linked cell.

 Top of Page


See Also

 

 

Excel > Forms

Add a list box or combo box to a worksheet

Excel 2007

You use a list box or a combo box, which are similar but slightly different controls, to let users make multiple choices of items or to enter their own value in a list. Typical examples of items in these types of lists are employee names, exchange rates, and product items.

What do you want to do?

Learn about list boxes and combo boxes

Add a list box (Form control)

Add a list box (ActiveX control)

Add a combo box (Form control)

Add a combo box (ActiveX control)

Learn about list boxes and combo boxes

List box  Displays a list of one or more items of text from which a user can choose.

List box (Form control)

List box (ActiveX control)

 

Combo box  Combines a text box with a list box to create a drop-down list box. A combo box is more compact than a list box, but it requires the user to click the down arrow to display the list of items. Use a combo box to enable a user either to type an entry or to choose only one item from a list. The control displays the current value in the text box, regardless of how that value was entered.

Combo box (Form control)

Combo box (ActiveX control)

 

 Top of Page

Add a list box (Form control)

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

Display the Developer tab

    1. Click the Microsoft Office Button , and then click Excel Options.
    2. 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 List box .

  1. Click the worksheet location where you want the upper-left corner of the list box to appear.
  2. On the Developer tab, in the Controls group, click Properties .

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

To specify the control properties, do the following:

    1. In the Input range box, enter a cell reference to a range that contains the values to display in the list box.
    2. In the Cell link box, enter a cell reference that contains the list box selection.

The linked cell returns the number of the selected item in the list box. The first item in the range returns a value of 1, the second item in the range returns a value of 2, and so on.

Use this number in a formula to return the actual item from the input range.

For example, a dessert preference form has a list box that is linked to cell C1, the input range for the list is D1:D5, and the items in the range are: "Ice Cream" (D1), "Cake" (D2), "Liqueur" (D3), "Candy" (D4), and "Chocolate" (D5). The following formula, entered in cell B1, returns the value "Liqueur" from range D1:D5 if the value of C1 is 3, based on the current selection in the list box.


=INDEX(D1:D5,C1)

    1. Under Selection type, specify how items can be selected in the list box by doing one of the following:
      • To create a single-selection list box, click Single.
      • To create a multiple-selection list box, click Multi.
      • To create an extended-selection list box, click Extend.

 Note    If you set the selection type to Multi or Extend, the cell that is specified in the Cell link box returns a value of 0 and is ignored. The Multi and Extend selection types require the use of Microsoft Visual Basic for Applications (VBA) code. In these cases, consider using the ActiveX list box control.

 Top of Page

Add a list box (ActiveX control)

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

Display the Developer tab

    1. Click the Microsoft Office Button , and then click Excel Options.
    2. 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 List Box .

  1. Click the worksheet location where you want the upper-left corner of the list box to appear.
  2. 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 .
  3. To specify the control properties, on the Developer tab, in the Controls group, click Properties .

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)

     
 

The default run time mode of the Input Method Editor (IME).

IMEMode (Form)

     
 

Whether the size of the control adjusts to display full or partial lines of text.

IntegralHeight (Form)

     
 

Whether multiple selections of items are permitted.

MultiSelect (Form)

     
 

The text in the control.

Text (Form)

     
 

How text is aligned in the control (left, center, or right).

TextAlign (Form)

     
 

Data and Binding:

 

     
 

The range that is linked to the control's value.

LinkedCell (Excel)

     
 

The content or state of the control.

Value (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 type of border (none or single-line).

BorderStyle (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)

     
 

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 List Box:

 

     
 

The source of data for multiple columns.

BoundColumn (Form)

     
 

The number of columns to display.

ColumnCount (Form)

     
 

A single row as a column heading.

ColumnHeads (Form)

     
 

The width of each column.

ColumnWidths (Form)

     
 

The range that is used to populate the list.

ListFillRange (Excel)

     
 

The list style (plain, with option buttons, or with check boxes).

ListStyle (Form)

     
 

How the control searches its list while the user types (first letter, complete entry, or none)

MatchEntry (Form)

     
 

The column to store in the Text property when the user selects a row.

TextColumn (Form)

     
 

The item that appears in the topmost position in the list.

TopIndex (Form)

     

 Notes 

  • To create a list box with multiple selection or extended-selection enabled, use the MultiSelect property. In this case, the LinkedCell property returns a #N/A value. You must use VBA code to process the multiple selections.
  • To create a two-column list box with column headers, set ColumnCount to 2, ColumnHeads to True, ColumnWidths to the width that you want for each column (for example, 72pt;72pt), ListFillRange to the range that is used to populate the list (for example, B2:C6), BoundColumn to either 1 or 2 to indicate which column value to save, and LinkedCell to a cell address that contains the selected value. By default, the column label is used as the column header (for example, Column B and Column C). To use your own column headers, place them immediately above the first value specified in ListFillRange (for example, B1 and C1) before you close the Properties dialog box. Finally, resize the list box to display both columns.
  • To create a list box that displays one value in the list box but saves another value in the linked cell, create a two-column list box, and then hide one of the columns by setting its ColumnWidths value to 0. For example, you can set up a two-column list box that contains the names of holidays in one column and dates associated with the holidays in a second column. To present the holiday names to users, specify the first column as the TextColumn. To store the dates of the holidays, specify the second column as the BoundColumn. To hide the dates of the holidays, set the ColumnWidths property of the second column to 0.

 Top of Page

Add a combo box (Form control)

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

Display the Developer tab

    1. Click the Microsoft Office Button , and then click Excel Options.
    2. 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 Combo box .

  1. Click the worksheet location where you want the upper-left corner of the combo box to appear.

The drop-down arrow is displayed with the text box collapsed.

  1. To display the text box, drag the left-center sizing handle to the right.
  2. On the Developer tab, in the Controls group, click Properties .

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

To specify the control properties, do the following:

    1. In the Input range box, enter a cell reference to a range that contains the values to display in the drop-down list of the combo box.
    2. In the Cell link box, enter a cell reference that contains the selection in the drop-down list of the combo box.

The linked cell returns the number of the selected item in the drop-down list of the combo box. The first item in the range returns a value of 1, the second item in the range returns a value of 2, and so on.

Use this number in a formula to return the actual item from the input range. For example, a dessert preference form has a combo box linked to cell C1, the input range for the list is D1:D5, and the items in the range are: "Ice Cream" (D1), "Cake" (D2), "Liqueur" (D3), "Candy" (D4), and "Chocolate" (D5). The following formula, entered in cell B1, returns the value "Liqueur" from range D1:D5 if the value of C1 is 3, based on the current selection in the combo box.


=INDEX(D1:D5,C1)

 Note    If you want to create a combo box that enables the user to edit the text in the text box, consider using the ActiveX Combo Box control.

    1. In the Drop-down lines box, enter the number of lines to display in the drop-down list of the combo box. If the value is:
      • 0, it is ignored and treated as 1.
      • Less than the number of items in the range specified in the Input range box, a scroll bar is displayed.
      • Equal to or greater than the number of items in the range specified in the Input range box, no scroll bar is displayed.

 Top of Page

Add a combo box (ActiveX control)

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

Display the Developer tab

    1. Click the Microsoft Office Button , and then click Excel Options.
    2. 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 Combo Box .

  1. Click the worksheet location where you want the upper-left corner of the combo box to appear.
  2. 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 .
  3. To specify the control properties, on the Developer tab, in the Controls group, click Properties .

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:

 

Whether a word or a character is the basic unit used to extend a selection.

AutoWordSelect (Form)

Font attributes (bold, italic, size, strikethrough, underline, and weight).

Bold, Italic, Size, StrikeThrough, Underline, Weight (Form)

Whether selected text remains highlighted when the control does not have the focus.

HideSelection (Form)

The default run time mode of the Input Method Editor (IME).

IMEMode (Form)

The maximum number of characters a user can enter.

MaxLength (Form)

Whether the user can select a line of text by clicking to the left of the text.

SelectionMargin (Form)

The text in the control.

Text (Form)

How text is aligned in the control (left, center, or right).

TextAlign (Form)

Data and binding:

 

The range that is linked to the control's value.

LinkedCell (Excel)

The content or state of the control.

Value (Form)

Size and position:

 

Whether the size of the control automatically adjusts to display all the contents.

AutoSize (Form)

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 background style (transparent or opaque).

BackStyle (Form)

The color of the border.

BorderColor (Form)

The type of border (none or single-line).

BorderStyle (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)

Keyboard and mouse:

 

Whether an automatic tab action occurs after a user has entered the maximum number of characters for the control.

AutoTab (Form)

Whether drag-and-drop is enabled.

DragBehavior (Form)

The selection behavior when entering the control (select all or do not change).

EnterFieldBehavior (Form)

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 combo box:

 

The source of data for multiple columns.

BoundColumn (Form)

The number of columns to be displayed.

ColumnCount (Form)

A single row as a column heading.

ColumnHeads (Form)

The width of each column.

ColumnWidths (Form)

The symbol that is displayed on the drop button (down arrow, plain, ellipsis, or underscore).

DropButtonStyle (Form)

The range that is used to populate the list.

ListFillRange (Excel)

The maximum number of rows to display in the list.

ListRows (Form)

The list style (plain, with option buttons, or with check boxes).

ListStyle (Form)

The width of the list.

ListWidth (Form)

How the control searches its list while the user types (first letter, complete entry, or none)

MatchEntry (Form)

Whether a value entered as text must match an entry in the existing list.

MatchRequired (Form)

When to show the drop button (never, with focus, or always).

ShowDropButtonWhen (Form)

How the user chooses or sets the value (drop-down combo or drop-down list).

Style (Form)

The column to store in the Text property when the user selects a row.

TextColumn (Form)

The item that appears in the topmost position in the list.

TopIndex (Form)

 Notes 

  • To create a two-column combo box with column headers, set ColumnCount to 2, ColumnHeads to True, ColumnWidths to the width that you want for each column (for example, 72pt;72pt), ListFillRange to the range that is used to populate the list (for example, B1:C6), BoundColumn to either 1 or 2 to indicate which column value to save, TextColumn to the column of data that you want displayed in the text box section of the combo box (which can be the same as or different from the BoundColumn value), and LinkedCell to a cell address that will contain the selected value. By default, the column label is used as the column header (for example, Column B and Column C). To use your own column headers, place them immediately above the first value specified in ListFillRange (for example, B1 and C1) before you close the Properties dialog box. Finally, resize the combo box to display both columns.
  • To create a combo box that displays one value in the combo box but saves another in the linked cell, create a two-column combo box, and then hide one of the columns by setting its ColumnWidths value to 0. For example, you can set up a two-column combo box that contains the names of holidays in one column and associated dates for the holidays in a second column. To present the holiday names to users, specify the first column as the TextColumn. To store the dates of the holidays, specify the second column as the BoundColumn. To hide the dates of the holidays, set the ColumnWidths property of the second column to 0.
  • To create a combo box that does not enable the user to enter new values, set Style to 2. To create a combo box that enables a user to enter new values that are not found in the list, set Style to 1, which is the default. In this case, you must write VBA code if you want to dynamically update the list values.

 Top of Page


See Also

 

 

Excel > Forms

Add a scroll bar or spin button to a worksheet

Excel 2007

You use a scroll bar or spin button to quickly enter or change a range of values.

What do you want to do?

Learn about scroll bars and spin buttons

Add a scroll bar (Form control)

Add a scroll bar (ActiveX control)

Add a spin button (Form control)

Add a spin button (ActiveX control)

Learn about scroll bars and spin buttons

Scroll bar  Scrolls through a range of values when you click the scroll arrows or when you drag the scroll box. You can move through a page (a preset interval) of values by clicking the region between the scroll box and either scroll arrow. Typically, a user can also type a text value directly in the associated cell or text box. Use a scroll bar for setting or adjusting a large range of values, or for cases when precision is not important. For example, use a scroll bar for a range of percentages that are estimates, or for adjusting color selection in a graduated way.

Scroll bar (Form control)

Scroll bar (ActiveX control)

 

Spin button  Makes it easier to increase or decrease a value, such as a number increment, time, or date. To increase the value, click the up arrow; to decrease the value, click the down arrow. A user can also type a text value directly in the associated cell or text box. Use a spin button, for example, to make it easier to enter a month, day, year number, or to increase a volume level.

Spin button (Form control)

Spin button (ActiveX control)

 

 Top of Page

Add a scroll bar (Form control)

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

Display the Developer tab

    1. Click the Microsoft Office Button , and then click Excel Options.
    2. 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 Scroll bar .

  1. Click the worksheet location where you want the upper-left corner of the scroll bar to appear.

 Note    The scroll bar is added in a top-down orientation.

  1. To orient the scroll bar from left to right, drag one of the sizing handles in a diagonal direction.
  2. On the Developer tab, in the Controls group, click Properties .

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

 Note    Before you click Properties, make sure that the object for which you want to examine or change properties is already selected.

To specify the control properties, do the following:

    1. In the Current value box, enter the initial value in the range of allowed values below that corresponds to the position of the scroll box in the scroll bar. This value must not be:
      • Less than the Minimum value; otherwise, the Minimum value is used.
      • Greater than the Maximum value; otherwise, the Maximum value is used.
    2. In the Minimum value box, enter the lowest value that a user can specify by positioning the scroll box closest to the top of a vertical scroll bar or the left end of a horizontal scroll bar.
    3. In the Maximum value box, enter the largest value that a user can specify by positioning the scroll box farthest from the top of a vertical scroll bar or the right end of a horizontal scroll bar.
    4. In the Incremental change box, enter the amount that the value increases or decreases and the degree to which the scroll box moves when the arrow at either end of the scroll bar is clicked.
    5. In the Page change box, enter the amount that the value increases or decreases and the degree to which the scroll box moves when you click the area between the scroll box and either of the scroll arrows. For example, in a scroll box with a minimum value of 0 and a maximum value of 10, if you set the Page change property to 2, the value will increase or decrease by 2 (in this case, 20% of the value range of the scroll box) when you click the area between the scroll box and either of the scroll arrows.
    6. In the Cell link box, enter a cell reference that contains the current position of the scroll box.

The linked cell returns the current value corresponding to the position of the scroll box.

Use this value in a formula to respond to the value of the cell specified in the Cell link box that corresponds to the current position of the scroll box. For example, if you create a risk factor scroll bar with the following properties:

Property

Value

       
 

Current value

100

       
 

Minimum value

0

       
 

Maximum value

100

       
 

Incremental change

1

       
 

Page change

5

       
 

Cell link

C1

       

With these settings, the user can use the scroll bar to enter a precise number or click the area between the scroll bar and arrow to change the value in increments of 5.

The following formula in cell D1 returns the exact value that is based on the current value in the linked cell:


=IF(C1 > 50, "Acceptable", "Unacceptable")

The following array formula in cell D1 assigns a grade to the risk factor, based on the current value in the linked cell.

=LOOKUP(A4,{0,20,40,60,80},{"F","D","C","B","A"})

 Note    Clicking the left or top scroll arrow after the minimum value has been reached or clicking the right or bottom arrow after the maximum value has been reached has no effect on the value returned. The scroll bar remains at either the minimum or maximum value and does not cycle through the range of allowed values.

 Top of Page

Add a scroll bar (ActiveX control)

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

Display the Developer tab

    1. Click the Microsoft Office Button , and then click Excel Options.
    2. 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 Scroll Bar .

  1. Click the worksheet location where you want the upper-left corner of the scroll bar to appear.
  2. To edit the control, make sure that you are in design mode. On the Developer tab, in the Controls group, turn on Design Mode .
  3. To specify the control properties, on the Developer tab, in the Controls group, click Properties .

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)

Data and binding:

 

The range that is linked to the control's value.

LinkedCell (Excel)

The content or state of the control.

Value (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)

Whether the orientation is vertical or horizontal.

Orientation (Form)

Formatting:

 

The background color.

BackColor (Form)

The foreground color.

ForeColor (Form)

Whether the control has a shadow.

Shadow (Excel)

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 scroll bar:

 

The delay in milliseconds after you click the scroll bar once.

Delay (Form)

The amount of movement that occurs when the user clicks the area between the scroll box and either of the scroll arrows.

LargeChange (Form)

The maximum and minimum allowed values.

Max, Min (Form)

Whether the size of the scroll box is either proportional or fixed to the scrolling region.

ProportionalThumb (Form)

The amount of movement that occurs when the user clicks a scroll arrow in the control.

SmallChange (Form)

 Top of Page

Add a spin button (Form control)

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

Display the Developer tab

    1. Click the Microsoft Office Button , and then click Excel Options.
    2. 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 Spin Button .

  1. Click the worksheet location where you want the upper-left corner of the spin button to appear.
  2. On the Developer tab, in the Controls group, click Properties .

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

To set the control properties, do the following:

    1. In the Current value box, enter the initial value of the spin button within the range of allowed values below. This value must not be:
      • Less than the Minimum value, otherwise the Minimum value is used.
      • Greater than the Maximum value, otherwise the Maximum value is used.
    2. In the Minimum value box, enter the lowest value that a user can specify by clicking the bottom arrow in the spin button.
    3. In the Maximum value box, enter the highest value that a user can specify by clicking the top arrow in the spin button.
    4. In the Incremental change box, enter the amount that the value increases or decreases when the arrows are clicked.
    5. In the Cell link box, enter a cell reference that contains the current position of the spin button.

The linked cell returns the current position of the spin button.

Use this value in a formula to respond to value of the cell specified in the Cell link box that corresponds to the current position of the spin button. For example, you create a spin button for setting the current age of an employee with the following properties:

Property

Value

Current value

35

Minimum value

21

Maximum value

70

Incremental change

1

Cell link

C1

With these settings, the user can click the spin button to enter an age that falls within a minimum and maximum age range. The median age of the employees is 35, and therefore 35 is a good choice to set as the starting value.

The following formula in cell D1 determines the length of employment that is based on the current age value in the cell that is linked to the spin button and the employee's age at hire date  the value in B1 (retrieved from another data source). The formula then computes a holiday bonus percentage that is based on years of service:


=(C1 - B1)* .01

 Note    Clicking the top arrow after the minimum value has been reached or clicking the bottom arrow after the maximum value has been reached has no effect on the value returned. The spin button remains at either the minimum or maximum value and does not cycle through the range of allowed values.

 Top of Page

Add a spin button (ActiveX control)

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

Display the Developer tab

    1. Click the Microsoft Office Button , and then click Excel Options.
    2. 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 Spin Button .

  1. Click the worksheet location where you want the upper-left corner of the spin button to appear.
  2. To edit the control, make sure that you are in design mode. On the Developer tab, in the Controls group, turn on Design Mode .
  3. To specify the control properties, on the Developer tab, in the Controls group, click Properties .

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)

Data and Binding:

 

The range that is linked to the control's value.

LinkedCell (Excel)

The content or state of the control.

Value (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)

Whether the orientation is vertical or horizontal.

Orientation (Form)

Formatting:

 

The background color.

BackColor (Form)

The foreground color.

ForeColor (Form)

Whether the control has a shadow.

Shadow (Excel)

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 spin button:

 

The delay in milliseconds after you click the spin button once.

Delay (Form)

The maximum and minimum allowed values.

Max, Min (Form)

The amount of movement that occurs when the user clicks a spin arrow in the control.

SmallChange (Form)

 Top of Page


See Also

 

 

Excel > Forms

Add an image control to a worksheet

Excel 2007

You use an image control to embed a picture, such as a bitmap (bitmap: A picture made from a series of small dots, much like a piece of graph paper with certain squares filled in to form shapes and lines. When stored as files, bitmaps usually have the extension .bmp.), JPEG (JPEG: A graphics file format (.jpg extension in Microsoft Windows) supported by many Web browsers that was developed for compressing and storing photographic images. It's best used for graphics with many colors, such as scanned photos.), or GIF (GIF: A graphics file format (.gif extension in Windows) used to display indexed-color graphics on the World Wide Web. It supports up to 256 colors and uses lossless compression, meaning that no image data is lost when the file is compressed.) and, for example, to display a company logo or clip art.

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

Display the Developer tab

    1. Click the Microsoft Office Button , and then click Excel Options.
    2. 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 Image .

  1. Click the worksheet location where you want the upper-left corner of the image control to appear.
  2. 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 .
  3. To specify the control properties, on the Developer tab, in the Controls group, click Properties .

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

The Properties dialog box appears. To add an image, click the Build button next to the Image property box, and then browse to an image file in the Load Picture dialog box.

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)

Size and Position:

 

Whether the size of the control automatically adjusts to display all contents.

AutoSize (Form)

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 background style (transparent or opaque).

BackStyle (Form)

The color of the border.

BorderColor (Form)

The type of border (none or single-line).

BorderStyle (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, I-beam).

MousePointer (Form)


See Also

 

 

Excel > Forms

Add or edit a macro for a control on a worksheet

Excel 2007

For forms and ActiveX controls (control: A graphical user interface object, such as a text box, check box, scroll bar, or command button, that lets users control the program. You use controls to display data or choices, perform an action, or make the user interface easier to read.) , you can do the following:

For more information about how to create and edit macros, see the Help section, Macros.

What do you want to do?

Add or edit a macro for a form control

Add or edit a macro for an ActiveX control

Add or edit a macro for a form control

  1. Right-click the control, and then click Assign Macro.

The Assign Macros dialog box appears.

  1. To specify the location of an existing macro, select where the macro is located in the Macros in box by doing one of the following:
    • To search for the macro in any workbook that is open, select All Open Workbooks.

 Note    If the macro that you want to assign to the control is in a separate workbook, open that workbook first so that it will be available in the Macros in list box.

    • To limit the search for the macro to the workbook that contains the current worksheet, select This Workbook.
    • To limit the search for the macro to a specific workbook, select that workbook from the list of available open workbook names.
  1. Do one of the following:

Assign a macro  Do one of the following:

For more information about how to write macros, see Visual Basic Help (Microsoft Visual Basic Help: To get help for Visual Basic in Excel, point to Macro on the Tools menu, and then click Visual Basic Editor. On the Help menu, click Microsoft Visual Basic Help.).

Modify an assigned macro  Do one of the following:

    • Edit the assigned macro  Click the name of the macro in the Macro Name box, and then click Edit.
    • Assign a different existing macro  Double-click a macro in the list or enter its name in the Macro name box.

 Top of Page

Add or edit a macro for an ActiveX control

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

Display the Developer tab

    1. Click the Microsoft Office Button , and then click Excel Options.
    2. 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. 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 .
  2. Select the control.

For more information, see Select or deselect controls on a worksheet.

  1. on the Developer tab, in the Controls group, click View Code .

 Note    You can also edit an existing macro by right-clicking the control, and then clicking View Code.

  1. In the Visual Basic Editor (Visual Basic Editor: An environment in which you write new and edit existing Visual Basic for Applications code and procedures. The Visual Basic Editor contains a complete debugging toolset for finding syntax, run-time, and logic problems in your code.), write a new macro or change the existing macro.

For more information about how to write macros, see Visual Basic Help (Microsoft Visual Basic Help: To get help for Visual Basic in Excel, point to Macro on the Tools menu, and then click Visual Basic Editor. On the Help menu, click Microsoft Visual Basic Help.).

  1. After you finish writing the macro, click Close and Return to Microsoft Excel on the File menu in the Visual Basic Editor.
  2. After you finish designing the control, on the Developer tab, in the Controls group, turn off Design Mode .

 Top of Page


See Also

 

 

Excel > Forms

Add or register an ActiveX control

Excel 2007

In addition to the various Form controls, your computer contains many ActiveX controls installed by Microsoft Office Excel and other programs, such as Calendar Control 12.0, and Windows Media Player. When you install new ActiveX controls (ActiveX control: A control, such as a check box or button that offers options to users or runs macros or scripts that automate a task. You can write macros for the control in Microsoft Visual Basic for Applications or scripts in Microsoft Script Editor.), the Setup program for the controls usually registers each control on your computer, which makes it available to use from Excel. If the control doesn't appear in the list, you must register it manually.

Important  Not all ActiveX controls can be used directly on worksheets; some can be used only on Microsoft Visual Basic for Applications (VBA) (Visual Basic for Applications (VBA): A macro-language version of Microsoft Visual Basic that is used to program Microsoft Windows-based applications and is included with several Microsoft programs.) UserForms. When you work with these controls, Excel displays the message Cannot insert object if you try to add them to a worksheet.

Add an ActiveX control

Register an ActiveX control

Add an ActiveX control

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

Display the Developer tab

    1. Click the Microsoft Office Button , and then click Excel Options.
    2. 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 .

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

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.

 Top of Page

Register an ActiveX control

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

Display the Developer tab

    1. Click the Microsoft Office Button , and then click Excel Options.
    2. 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 .

  1. Click the worksheet location where you want the upper-left corner of the ActiveX control to appear.
  2. 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 .
  3. At the bottom of the More Controls dialog box, click Register Custom.
  4. In the Register Custom Control dialog box, locate the folder that contains the control file (.ocx file name extension) or dynamic link library file (.dll file name extension) for the control that you want to register.
  5. Select the file for your control, and then click Open.

 Top of Page


See Also

 

 

Excel > Forms

Add, edit, find, and delete rows by using a data form

Excel 2007

When a row of data is very wide and requires repeated horizontal scrolling, consider using a data form to add, edit, find, and delete rows.

What do you want to do?

Learn about data forms

Create a data form

Use a data form

Add a new row of data

Find a row by navigating

Find a row by entering search criteria

Change data in a row

Delete a row

Close a data form

Learn about data forms

A data form provides a convenient means to enter or display one complete row of information in a range or table without scrolling horizontally. You may find that using a data form can make data entry easier than moving from column to column when you have more columns of data than can be viewed on the screen. Use a data form when a simple form of text boxes that list the column headings as labels is sufficient and you don't need sophisticated or custom form features, such as a list box or spin button.

Microsoft Office Excel can automatically generate a built-in data form (data form: A dialog box that displays one complete record at a time. You can use data forms to add, change, locate, and delete records.) for your range (range: Two or more cells on a sheet. The cells in a range can be adjacent or nonadjacent.) or table (table: A collection of data about a particular subject that is stored in records (rows) and fields (columns).). The data form displays all column headers as labels in a single dialog box. Each label has an adjacent blank text box in which you can enter data for each column, up to a maximum of 32 columns. In a data form, you can enter new rows, find rows by navigating, or (based on cell contents) update rows and delete rows. If a cell contains a formula (formula: A sequence of values, cell references, names, functions, or operators in a cell that together produce a new value. A formula always begins with an equal sign (=).), the formula result is displayed in the data form, but you cannot change the formula by using the data form.

 Note    You cannot print a data form. In addition, because a data form is a modal dialog box, you cannot use either the Excel Print command or Print button until you close the data form. Alternatively, you can use the Windows Print Screen key to make an image of the form, and then copy it to Microsoft Paint or another program. For more information, see the help topic, Copy the active window or screen contents.

 Top of Page

Create a data form

  1. If necessary, add a column header to each column in the range or table. Excel uses these column headers to create labels for each field on the form.

Important  Make sure that there are no blank lines in the range of data.

  1. Click a cell in the range or table to which you want to add the form.
  2. To add the Form button to the Quick Access Toolbar, do the following:
    1. Click the arrow next to the Quick Access Toolbar, and then click More Commands.
    2. In the Choose commands from box, click All Commands, and then select the Form button in the list.
    3. Click Add, and then click OK.
  3. On the Quick Access Toolbar, click Form .

I see a message that states "Too many fields in the data form"

 Top of Page

Use a data form

You can use a data form to add, find, change, and delete rows in a range or table.

Add a new row of data

  1. In the data form, click New.
  2. Type the data for the new row.

To move to the next field in the row, press TAB. To move to the previous field, press SHIFT+TAB.

  1. After you have finished typing data, press ENTER to add the row to the bottom of the range or table.

I see a message that states "Cannot extend list or database"

 Note    Before you press ENTER, you can undo any changes by clicking Restore. Any data that you have typed in the fields is discarded.

 Top of Page

Find a row by navigating

Do one or more of the following:

  • To move through rows one at a time, use the scroll bar arrows in the data form.
  • To move through 10 rows at a time, click the scroll bar in the area between the arrows.
  • To move to the next row in the range or table, click Find Next.
  • To move to the previous row in the range or table, click Find Prev.

 Top of Page

Find a row by entering search criteria

  1. Click Criteria, and then enter the comparison criteria (comparison criteria: A set of search conditions that is used to find data. Comparison criteria can be a series of characters that you want to match, such as "Northwind Traders," or an expression, such as ">300.") in the data form.

All items that begin with the comparison criteria are filtered. For example, if you type the text Dav as a criterion, Excel finds "Davidovski" and "Davis." To find text values that share some characters but not others, use a wildcard character as your criterion.

The following wildcard characters can be used as comparison criteria for filters, and when you search for and replace content.

Use

To find

? (question mark)

Any single character
For example, sm?th finds "smith" and "smyth"

* (asterisk)

Any number of characters
For example, *east finds "Northeast" and "Southeast"

~ (tilde) followed by ?, *, or ~

A question mark, asterisk, or tilde
For example, fy91~? finds "fy91?"

  1. To find rows that match the criteria, click Find Next or Find Prev.
  2. To return to the data form so that you can add, change, or delete rows, click Form.

 Top of Page

Change data in a row

  1. Find the row that you want to change.

For more information, see the sections Find a row by navigating and Find a row by entering search criteria.

  1. Change the data in the row.

To move to the next field in the row, press TAB. To move to the previous field, press SHIFT+TAB.

  1. After you finish changing data, press ENTER to update the row.

Excel automatically moves to the next row.

 Note    Before you press ENTER, you can undo any changes by clicking Restore.

 Top of Page

Delete a row

  1. In the data form, find the row that you want to delete.

For more information, see the sections Find a row by navigating and Find a row by entering search criteria.

  1. Click Delete.

Warning  Excel prompts you to confirm the operation. You cannot undo a row deletion after you confirm it.

 Top of Page

Close a data form

To close the data form and return to the worksheet, click Close.

 Top of Page


See Also

 

 

Excel > Forms

Delete controls on a worksheet

Excel 2007

  1. If one or more controls is an ActiveX control, do the following:
    1. Make sure that the Developer tab is available.

Display the Developer tab

      1. Click the Microsoft Office Button , and then click Excel Options.
      2. 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. Make sure that you are in design mode. On the Developer tab, in the Controls group, turn on Design Mode .
  1. Select the control or controls that you want to delete.

For more information, see Select or deselect controls on a worksheet.

  1. Press DELETE.


See Also

 

 

Excel > Forms

Edit text in a control on a worksheet

Excel 2007

You can edit the text that is displayed in a Form control or ActiveX control, such as a label or help information, and you can edit the alternative text description for a control.

What do you want to do?

Edit the text in a Form control

Edit the text in an ActiveX control

Edit an alternative text description for a control

Edit the text in a Form control

  1. Select the Form control.

For more information, see Select or deselect controls on a worksheet.

  1. Right-click the selection, and then click Edit Text.

The control border shows a dashed pattern.

  1. Edit the text for the control.
  2. After you have finished editing the text, right-click the selection, and then click Exit Edit Text.

 Top of Page

Edit the text in an ActiveX control

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

Display the Developer tab

    1. Click the Microsoft Office Button , and then click Excel Options.
    2. 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. Make sure that you are in design mode. On the Developer tab, in the Controls group, turn on Design Mode .
  2. Select the ActiveX control.

For more information, see Select or deselect controls on a worksheet.

  1. Right-click the selection.
  2. Point to the name of the object (for example, CheckBox Object), and then click Edit.
  3. Edit the text for the control.
  4. After you have finished editing the text, press ESC.

 Top of Page

Edit an alternative text description for a control

Web browsers display alternative text (alt text) while images are loading, if pictures are missing, and can also display alternative text if you position the pointer over an image. Web search engines use alternative text to help find Web pages. Alternative text is also used to help users who have disabilities.

  1. Select the control.

For more information, see Select or deselect controls on a worksheet.

  1. Right-click the selection, click Format Control, and then click the Web tab.
  2. In the Alternative text box, type the text that you want displayed.


See Also

 

 

Excel > Forms

Group, copy, move, or align controls on a worksheet

Excel 2007

After you add Form and ActiveX controls (control: A graphical user interface object, such as a text box, check box, scroll bar, or command button, that lets users control the program. You use controls to display data or choices, perform an action, or make the user interface easier to read.) to a worksheet form, you may want to group, copy, move, or align controls to create a well designed, user friendly form.

What do you want to do?

Group, ungroup, or regroup controls

Copy one or more controls

Move one or more controls

Move a control forward or backward in the object stacking order

Align and distribute controls

Group, ungroup, or regroup controls

When you group controls, you combine them so that you can work with them as if they were a single control. For example, you can resize or move all controls in a group (group: A collection of objects that behave as one for the purpose of moving, resizing, or rotating them. A group can be composed of multiple sets of groups.) as a single unit.

 Note    You cannot combine Form controls or ActiveX controls with Drawing Tools or SmartArt Tools objects (such as Shapes and SmartArt graphics) in the same group selection.

Do one of the following:

Group controls

  1. If one or more controls is an ActiveX control, do the following:
    1. Make sure that the Developer tab is available.

Display the Developer tab

      1. Click the Microsoft Office Button , and then click Excel Options.
      2. 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. Make sure that you are in design mode. On the Developer tab, in the Controls group, turn on Design Mode .
  1. Select the controls that you want to group. For more information, see Select or deselect controls on a worksheet.
  2. Right-click the selection, point to Grouping, and then click Group.

Ungroup controls

  1. If one or more controls is an ActiveX control, do the following:
    1. Make sure that the Developer tab is available.

Display the Developer tab

      1. Click the Microsoft Office Button , and then click Excel Options.
      2. 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. Make sure that you are in design mode. On the Developer tab, in the Controls group, turn on Design Mode .
  1. Select the group that you want to ungroup. For more information, see Select or deselect controls on a worksheet.
  2. Right-click the selection, point to Grouping, and then click Ungroup.
    1. To continue ungrouping, click Yes when the message box appears.
    2. To change an individual control, continue to select and ungroup controls until the one that you want becomes available.

Regroup controls

  1. If one or more controls is an ActiveX control, do the following:
    1. Make sure that the Developer tab is available.

Display the Developer tab

      1. Click the Microsoft Office Button , and then click Excel Options.
      2. 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. Make sure that you are in design mode. On the Developer tab, in the Controls group, turn on Design Mode .
  1. Select any one of the controls that was previously grouped. For more information, see Select or deselect controls on a worksheet.
  2. Right-click the selection, point to Grouping, and then click Regroup.

 Top of Page

Copy one or more controls

You can copy one or more controls in several ways.

 Note    You cannot combine Form controls or ActiveX controls with Drawing Tools or SmartArt Tools objects (such as Shapes and SmartArt graphics) in the same group selection.

By using the Copy and Paste commands

  1. If one or more controls is an ActiveX control, do the following:
    1. Make sure that the Developer tab is available.

Display the Developer tab

      1. Click the Microsoft Office Button , and then click Excel Options.
      2. 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. Make sure that you are in design mode. On the Developer tab, in the Controls group, turn on Design Mode .
  1. Select the control or controls. For more information, see Select or deselect controls on a worksheet.
  2. To make a single duplicate of a control, on the Home tab, in Clipboard group, click Copy, and then click Paste .

To make multiple duplicates, repeat pasting until you have the number of copies that you want.

By using the keyboard and the mouse

  1. If one or more controls is an ActiveX control, do the following:
    1. Make sure that the Developer tab is available.

Display the Developer tab

      1. Click the Microsoft Office Button , and then click Excel Options.
      2. 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. Make sure that you are in design mode. On the Developer tab, in the Controls group, turn on Design Mode .
  1. Select the control or controls. For more information, see Select or deselect controls on a worksheet.
  2. Press CTRL and drag the control.

To make multiple duplicates, repeat dragging until you have the number of copies that you want.

 Top of Page

Move one or more controls

You can move one or more controls in several ways.

 Note    You cannot combine Form controls and ActiveX controls with Drawing Tools or SmartArt Tools objects (such as Shapes and SmartArt graphics) in the same group selection.

By using the mouse

  1. If one or more controls is an ActiveX control, do the following:
    1. Make sure that the Developer tab is available.

Display the Developer tab

      1. Click the Microsoft Office Button , and then click Excel Options.
      2. 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. Make sure that you are in design mode. On the Developer tab, in the Controls group, turn on Design Mode .
  1. Select the control or controls. For more information, see Select or deselect controls on a worksheet.
  2. Position the pointer over the control until the pointer changes to a cross pointer, and then drag the selected control or controls to another location.

By using the keyboard

  1. If one or more controls is an ActiveX control, do the following:
    1. Make sure that the Developer tab is available.

Display the Developer tab

      1. Click the Microsoft Office Button , and then click Excel Options.
      2. 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. Make sure that you are in design mode. On the Developer tab, in the Controls group, turn on Design Mode .
  1. Select the control or controls. For more information, see Select or deselect controls on a worksheet.
  2. Press the arrow keys to move the control in single pixel (pixel: A single unit of measurement that your computer's display hardware uses to paint images on your screen. These units, which often appear as tiny dots, compose the pictures displayed by your screen.) increments.

 Top of Page

Move a control forward or backward in the object stacking order

Controls and other objects on the drawing canvas (drawing canvas: An area on which you can draw multiple shapes. Because the shapes are contained within the drawing canvas, they can be moved and resized as a unit.) automatically stack in individual layers as you add them. You can see the stacking order when controls overlap  the top control partially covers the controls underneath it.

 Note    Form and ActiveX controls have an object stacking order that is separate and distinct from the Drawing Tools and SmartArt Tools objects, such as Shapes and SmartArt graphics.

  1. If one or more controls is an ActiveX control, do the following:
    1. Make sure that the Developer tab is available.

Display the Developer tab

      1. Click the Microsoft Office Button , and then click Excel Options.
      2. 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. Make sure that you are in design mode. On the Developer tab, in the Controls group, turn on Design Mode .
  1. Select the control. For more information, see Select or deselect controls on a worksheet.
  2. Right-click the selection, point to Order, and then do the following:
    1. To move the control one layer up in the stacking order, click Bring Forward.
    2. To move the control to the top layer in the stacking order, click Bring to Front.
    3. To move the control one layer down in the stacking order, click Send Backward.
    4. To move the control to the bottom layer in the stacking order, clickSend to Back.

 Top of Page

Align and distribute controls

Important  To do the following procedures, you must add the Align button menu on the Drawing Tools tab to the Quick Access Toolbar.

Add the Align button menu from the Drawing Tools tab to the Quick Access Toolbar

  1. Click the arrow next to the Quick Access Toolbar, and then click More Commands.
  2. Under Choose commands from, select All Commands.
  3. In the list, select Align .
  4. Click Add, and then click OK.

 Note    You cannot combine Form controls and ActiveX controls with SmartArt Tools objects (such as Shapes and SmartArt) in the same group selection.

Align all controls to the grid or to shapes

Do one of the following:

  • To align all objects with the upper-left corner of a cell, on the Quick Access Toolbar, click the arrow next to Align , and then click Snap to Grid .

 Note    The Snap To feature works whether gridlines are turned on or off. You can also align controls with cell gridlines by holding the ALT key while you move a control or object.

  • To automatically align controls with the vertical and horizontal edges of other shapes when you move or draw them, on the Quick Access Toolbar, click the arrow next to Align , and then click Snap to Shape .

Align controls by their edges

Important  Aligning controls can cause them to stack on top of each other. Make sure that the controls are positioned relative to each other in the way that you want before you run a command to align them.

  1. If one or more controls is an ActiveX control, do the following:
    1. Make sure that the Developer tab is available.

Display the Developer tab

      1. Click the Microsoft Office Button , and then click Excel Options.
      2. 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. Make sure that you are in design mode. On the Developer tab, in the Controls group, turn on Design Mode .
  1. Select the controls. For more information, see Select or deselect controls on a worksheet.
  2. To align the controls, on the Quick Access Toolbar, click the arrow next to Align , and then do one of the following:
    1. To align the controls by the top-most control, click Align Top .
    2. To align the controls by the bottom-most control, click Align Bottom .
    3. To align the controls by the left-most control, click Align Left .
    4. To align the controls by the right-most control, Align Right .

Align controls horizontally or vertically

  1. If one or more controls is an ActiveX control, do the following:
    1. Make sure that the Developer tab is available.

Display the Developer tab

      1. Click the Microsoft Office Button , and then click Excel Options.
      2. 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. Make sure that you are in design mode. On the Developer tab, in the Controls group, turn on Design Mode .
  1. Select the controls. For more information, see Select or deselect controls on a worksheet.
  2. To align the controls, on the Quick Access Toolbar, click the arrow next to Align , and then do one of the following:
    1. To align controls horizontally through the middle of the controls, click Align Middle .
    2. To align controls vertically through the centers of the controls, click Align Center .

Distribute controls horizontally or vertically

  1. If one or more controls is an ActiveX control, do the following:
    1. Make sure that the Developer tab is available.

Display the Developer tab

      1. Click the Microsoft Office Button , and then click Excel Options.
      2. 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. Make sure that you are in design mode. On the Developer tab, in the Controls group, turn on Design Mode .
  1. Select at least three controls. For more information, see Select or deselect controls on a worksheet.
  2. To distribute the controls, on the Quick Access Toolbar, click the arrow next to Align , and then do one of the following:
    1. To evenly space controls horizontally, click Distribute Horizontally .
    2. To evenly space controls vertically, click Distribute Vertically .

 Top of Page


See Also

 

 

Excel > Forms

Overview of forms, Form controls, and ActiveX controls on a worksheet

Excel 2007

Yes, it is true. You can create great forms with little or no need for Microsoft Visual Basic for Applications (VBA) code in Microsoft Office Excel. By using forms and the many controls and objects that you can add to them, you can significantly enhance data entry on your worksheets and improve the way your worksheets are displayed.

In this article

What is a form?

Types of Excel forms

Data form

Worksheet with form and ActiveX controls

Form controls

ActiveX controls

Drawing tools objects

Working with controls and objects on a worksheet

Determining the type of control on a worksheet

VBA UserForms

What is a form?

A form, whether printed or online, is a document designed with a standard structure and format that makes it easier to capture, organize, and edit information.

  • Printed forms contain instructions, formatting, labels, and blank spaces for writing or typing data. You can use Excel and Excel templates to create printed forms.

For more information about Excel templates, see the See Also section.

You can use Excel in several ways to create printed and online forms.

 Top of Page

Types of Excel forms

There are several types of forms that you can create in Excel: data forms, worksheets that contain Form and ActiveX controls, and VBA UserForms. You can use each type of form by itself, or you can combine them in different ways to create a solution that's right for you.

Data form

A data form (data form: A dialog box that displays one complete record at a time. You can use data forms to add, change, locate, and delete records.) provides a convenient way to enter or display one complete row of information in a range or table without scrolling horizontally. You may find that using a data form can make data entry easier than moving from column to column when you have more columns of data than can be viewed on the screen. Use a data form when a simple form of text boxes that list the column headings as labels is sufficient and you don't need sophisticated or custom form features, such as a list box or spin button.

Excel can automatically generate a built-in data form for your range (range: Two or more cells on a sheet. The cells in a range can be adjacent or nonadjacent.) or table (table: A collection of data about a particular subject that is stored in records (rows) and fields (columns).). The data form displays all column headers as labels in a single dialog box. Each label has an adjacent blank text box in which you can enter data for each column, up to a maximum of 32 columns. In a data form, you can enter new rows, find rows by navigating, or (based on cell contents) update rows and delete rows . If a cell contains a formula (formula: A sequence of values, cell references, names, functions, or operators in a cell that together produce a new value. A formula always begins with an equal sign (=).), the formula result is displayed in the data form, but you cannot change the formula by using the data form.

 Top of Page

Worksheet with Form and ActiveX controls

A worksheet is a type of form that enables you to enter and view data on the grid, and there are several control-like features already built-in to Excel worksheets, such as comments and data validation. Cells resemble text boxes in that you can enter and format them in a variety of ways. Cells are often used as labels, and by adjusting cell height and width and merging cells, you can make a worksheet behave like a simple data entry form. Other control-like features, such as cell comments, hyperlinks, background images, data validation, conditional formatting, embedded charts, and AutoFilter can make a worksheet behave like an advanced form.

For added flexibility, you can add controls and other drawing objects to the drawing canvas (drawing canvas: An area on which you can draw multiple shapes. Because the shapes are contained within the drawing canvas, they can be moved and resized as a unit.) of a worksheet, and combine and coordinate them with worksheet cells. For example, you can use a list box control to make it easier for a user to select from a list of items. Or, you can use a spin button control to make it easier for a user to enter a number.

Because controls and objects are stored on the drawing canvas, you can display or view controls and objects alongside associated text that is independent of row and column boundaries without changing the layout of a grid or table of data on your worksheet. Most of the time, many of these controls can also be linked to cells on the worksheet and do not require VBA code to make them work. You can set properties that determine whether a control floats freely or moves and resizes together with a cell. For example, you might have a check box that you want to move together with its underlying cell when the range is sorted. However, if you have a list box that you want to keep in a specific location at all times, you probably do not want it to move together with its underlying cell.

Excel has two types of controls: Form controls and ActiveX Controls. In addition to these sets of controls, you can also add objects from the Drawing tools, such as a AutoShapes (AutoShapes: A group of ready-made shapes that includes basic shapes, such as rectangles and circles, plus a variety of lines and connectors, block arrows, flowchart symbols, stars and banners, and callouts.), WordArt (WordArt: Text objects you create with ready-made effects to which you can apply additional formatting options.), SmartArt graphic, or text boxes.

The following sections describe these controls and drawing objects, and also explain how to work with these controls and objects in more detail.

 Top of Page

Form controls

Form controls are the original controls that are compatible with earlier versions of Excel, starting with Excel version 5.0. Form controls are also designed for use on XLM macro sheets.

You use Form controls when you want to easily reference and interact with cell data without using VBA code, and when you want to add controls to chart sheets (chart sheet: A sheet in a workbook that contains only a chart. A chart sheet is beneficial when you want to view a chart or a PivotChart report separately from worksheet data or a PivotTable report.). For example, after you add a list box control to a worksheet and linking it to a cell, you can return a numeric value for the current position of the selected item in the control. You can then use that numeric value in conjunction with the INDEX function to select different items from the list.

You can also run macros by using Form controls. You can attach an existing macro to a control, or write or record a new macro. When a user of the form clicks the control, the control runs the macro.

However, these controls cannot be added to UserForms, used to control events, or modified to run Web scripts on Web pages.

Summary of form controls

Button Name

Example

Description

Label

Identifies the purpose of a cell or text box, or displays descriptive text (such as titles, captions, pictures) or brief instructions.

Group box

Groups related controls into one visual unit in a rectangle with an optional label. Typically, option buttons, check boxes, or closely related contents are grouped.

Button

Runs a macro that performs an action when a user clicks it. A button is also referred to as a push button.

Check box

Turns on or off a value that indicates an opposite and unambiguous choice. You can select more than one check box on a worksheet or in a group box. A check box can have one of three states: selected (turned on), cleared (turned off), and mixed, meaning a combination of on and off states (as in a multiple selection).

Option button

Allows a single choice within a limited set of mutually exclusive choices; an option button is usually contained in a group box or a frame. An option button can have one of three states: selected (turned on), cleared (turned off), and mixed, meaning a combination of on and off states (as in a multiple selection). An option button is also referred to as a radio button.

List box

Displays a list of one or more items of text from which a user can choose. Use a list box for displaying large numbers of choices that vary in number or content. There are three types of list boxes:

  • A single-selection list box enables only one choice. In this case, a list box resembles a group of option buttons, except that a list box can handle a large number of items more efficiently.
  • A multiple-selection list box enables either one choice or contiguous (adjacent) choices.
  • An extended-selection list box enables one choice, contiguous choices, and noncontiguous (or disjointed) choices.

Combo box

Combines a text box with a list box to create a drop-down list box. A combo box is more compact than a list box but requires the user to click the down arrow to display the list of items. Use a combo box to enable a user to either type an entry or choose only one item from the list. The control displays the current value in the text box, regardless of how that value is entered.

Scroll bar

Scrolls through a range of values when you click the scroll arrows or drag the scroll box. In addition, you can move through a page (a preset interval) of values by clicking the area between the scroll box and either of the scroll arrows. Typically, a user can also type a text value directly into an associated cell or text box.

Spin button

Increases or decreases a value, such as a number increment, time, or date. To increase the value, click the up arrow; to decrease the value, click the down arrow. Typically, a user can also type a text value directly into an associated cell or text box.

 Note    The following controls are unavailable in Office Excel 2007 workbooks. These controls can be used in Excel version 5.0 dialog sheets only.

Button Name

Text Field

Combo List - Edit

Combo Drop - Down Edit

Run Dialog

 Top of Page

ActiveX controls

ActiveX controls (ActiveX control: A control, such as a check box or button that offers options to users or runs macros or scripts that automate a task. You can write macros for the control in Microsoft Visual Basic for Applications or scripts in Microsoft Script Editor.) can be used on worksheet forms, with or without the use of VBA code, and on VBA UserForms. In general, use ActiveX controls when you need more flexible design requirements than those provided by Form controls. ActiveX controls have extensive properties that you can use to customize their appearance, behavior, fonts, and other characteristics.

You can also control different events that occur when an ActiveX control is interacted with. For example, you can perform different actions, depending on which choice a user selects from a list box control, or you can query a database to refill a combo box with items when a user clicks a button. You can also write macros that respond to events associated with ActiveX controls. When a user of the form interacts with the control, your VBA code then runs to process any events that occur for that control.

Your computer also contains many ActiveX controls that were installed by Excel and other programs, such as Calendar Control 12.0 and Windows Media Player.

Important  Not all ActiveX controls can be used directly on worksheets; some can be used only on Visual Basic for Applications (VBA) (Visual Basic for Applications (VBA): A macro-language version of Microsoft Visual Basic that is used to program Microsoft Windows-based applications and is included with several Microsoft programs.) UserForms. If you try to add any one of these particular ActiveX controls to a worksheet, Excel displays the message "Cannot insert object."

However, ActiveX controls cannot be added to chart sheets from the user interface or to XLM macro sheets. You also cannot assign a macro to run directly from an ActiveX control the same way you can from a Form control.

Summary of ActiveX controls

Button Name

Example

Description

Check box

Turns on or off a value that indicates an opposite and unambiguous choice. You can select more than one check box at a time on a worksheet or in a group box. A check box can have one of three states: selected (turned on), cleared (turned off), and mixed, meaning a combination of on and off states (as in a multiple selection).

Text box

Enables you to, in a rectangular box, view, type, or edit text or data that is bound to a cell. A text box can also be a static text field that presents read-only information.

Command button

Runs a macro that performs an action when a user clicks it. A command button is also referred to as a push button.

Option button

Allows a single choice within a limited set of mutually exclusive choices usually contained in a group box or frame. An option button can have one of three states: selected (turned on), cleared (turned off), and mixed, meaning a combination of on and off states (as in a multiple selection). An option button is also referred to as a radio button.

List box

Displays a list of one or more items of text from which a user can choose. Use a list box for displaying large numbers of choices that vary in number or content. There are three types of list boxes:

  • A single-selection list box enables only one choice. In this case, a list box resembles a group of option buttons, except that a list box can handle a large number of items more efficiently.
  • A multiple selection list box enables either one choice or contiguous (adjacent) choices.
  • An extended-selection list box enables one choice, contiguous choices, and noncontiguous (or disjointed) choices.

Combo box

Combines a text box with a list box to create a drop-down list box. A combo box is more compact than a list box, but requires the user to click the down arrow to display the list of items. Use to allow a user to either type an entry or choose only one item from the list. The control displays the current value in the text box, regardless of how that value is entered.

Toggle button

Indicates a state, such as Yes/No, or a mode, such as On/Off. The button alternates between an enabled and disabled state when it is clicked.

Spin button

Increases or decreases a value, such as a number increment, time, or date. To increase the value, click the up arrow; to decrease the value, click the down arrow. Typically, a user can also type a text value into an associated cell or text box.

Scroll bar

Scrolls through a range of values when you click the scroll arrows or drag the scroll box. In addition, you can move through a page (a preset interval) of values by clicking the area between the scroll box and either of the scroll arrows. Typically, a user can also type a text value directly into an associated cell or text box.

Label

Identifies the purpose of a cell or text box, displays descriptive text (such as titles, captions, pictures), or provides brief instructions.

Image

Embeds a picture, such as a bitmap (bitmap: A picture made from a series of small dots, much like a piece of graph paper with certain squares filled in to form shapes and lines. When stored as files, bitmaps usually have the extension .bmp.), JPEG (JPEG: A graphics file format (.jpg extension in Microsoft Windows) supported by many Web browsers that was developed for compressing and storing photographic images. It's best used for graphics with many colors, such as scanned photos.), or GIF (GIF: A graphics file format (.gif extension in Windows) used to display indexed-color graphics on the World Wide Web. It supports up to 256 colors and uses lossless compression, meaning that no image data is lost when the file is compressed.).


Frame control

A rectangular object with an optional label that groups related controls into one visual unit. Typically, option buttons, check boxes, or closely related contents are grouped in a frame control.

 Note    The ActiveX frame control is not available in the ActiveX Controls section of the Insert command. However, you can add the control from the More Controls dialog box by selecting Microsoft Forms 2.0 Frame.

More Controls

 

Displays a list of additional ActiveX controls available on your computer that you can add to a custom form, such as Calendar Control 12.0 and Windows Media Player. You can also register a custom control in this dialog box.


 Top of Page

Drawing Tool objects

You may also want to include SmartArt graphics, Shapes, WordArt, and text boxes on your form. You can resize, rotate, flip, color, and combine these objects to create even more complex shapes. When you type text directly in a Shape or text box object, the text becomes part of that object  if you rotate or flip the object, the text rotates or flips with it. Unlike ActiveX controls, you can assign different attributes, such as font size and font style, to individual words and characters in the object. You can also assign macros and add hyperlinks to these objects. You can even link text in a Shape or text box object to a worksheet cell and dynamically display updated values in those objects.

 Top of Page

Working with controls and objects on the worksheet form

After adding forms and ActiveX to a worksheet form, you usually want to fine-tune and rearrange the controls in a variety of ways to create a well-designed, user friendly form. Common tasks include the following:

  • Controlling the display of gridlines while you work with the controls, and deciding whether to display the gridlines to the user on the final worksheet form.
  • Selecting and deselecting controls so that you can specify properties or make additional adjustments.
  • Editing text in a control, such as the caption or label.
  • Grouping, copying, moving, and aligning controls to organize the layout of the worksheet form.
  • Resizing and formatting controls to obtain the appearance that you want.
  • Positioning or sizing a control with a cell.
  • Protecting controls and linked cells according to your specific data protection needs.
  • Enabling or disabling the printing of controls when the worksheet form is printed.
  • Deleting unused controls.

You can design a worksheet form with or without cell gridlines in the background. For example, you might want to turn off cell gridlines and then format all the cells with the same color or pattern, or even use a picture as a sheet background. To hide or show the gridlines, on the View tab, in the Show/Hide group, clear or select the Gridlines check box.

For more information, see the See Also section of this topic.

 Top of Page

Determining the type of control that is on your worksheet

Because there are three different types of controls and objects that you can modify uniquely, you might not know for sure which type of control it is just by looking at it. To determine the type of control (Form or ActiveX), select and right-click the control, and then display the shortcut menu:

  • If the shortcut menu contains the command Properties, the control is an ActiveX control, and you are in design mode.
  • If the shortcut menu contains the command Assign Macro, the control is a Form control.

Tip  To display the correct shortcut menu for the group box Form control, make sure that you select the perimeter instead of the interior of the group box.

  • If the shortcut menu contains the command Edit Text, the object is a Drawing object.

 Top of Page

VBA UserForms

For maximum flexibility, you can create UserForms, which are custom dialog boxes, that usually include one or more ActiveX controls. You make UserForms available from VBA code that you create in the Visual Basic Editor (Microsoft Visual Basic Editor: An environment in which you can edit macros that you've recorded and write new macros and Visual Basic for Applications programs.). The high-level steps for creating a UserForm are as follows:

  1. Insert a UserForm into your workbook's VBAProject. You access a workbook's VBAProject by first displaying the Visual Basic Editor (press ALT+F11) and then, on the Insert menu, clicking UserForm.
  2. Write a procedure to display the UserForm.
  3. Add ActiveX controls.
  4. Modify properties for the ActiveX controls.
  5. Write event-handler procedures for the ActiveX controls.

By using UserForms, you can also utilize advanced form functionality,. For example, you can programmatically add a separate option button for each letter of the alphabet or you can add a check box for each item in a large list of dates and numbers.

Before creating a UserForm, consider using built-in dialog boxes available from Excel that might fit your needs. These built-in dialog boxes include the VBA InputBox and MsgBox functions, the Excel InputBox method, GetOpenFilename method, GetSaveAsFilename method, and the Dialogs object of the Application object, which contains all the built-in Excel dialog boxes.

For more information, see the help topic Find Help on using the Visual Basic Editor, and explore the Microsoft Office Excel Developer Center.

 Top of Page


See Also

 

 

Excel > Forms

Position and size a control with its underlying cell on a worksheet

Excel 2007

At times, you may want a control to act independently of its underlying cell (the cell which contains the upper leftmost corner of the control). At other times, you may want the control to move and size with its underlying cell. For example, if you have a check box that is linked with a particular cell or row, you may want that check box to move with the row when the range is sorted. However, if you have a list box that you want to keep in a specific location at all times, you do not want it to move with its underlying cell.

  1. If one or more controls is an ActiveX control:
    1. Make sure that the Developer tab is available.

Display the Developer tab

      1. Click the Microsoft Office Button , and then click Excel Options.
      2. 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. Make sure that you are in design mode. On the Developer tab, in the Controls group, turn on Design Mode .
  1. Select the control.

For more information, see Select or deselect controls on a worksheet.

  1. Right-click the selection, click Format Control, and then click the Properties tab.
  2. Under Object Positioning, do one of the following:
    1. To make the control stay with a cell when the cell moves (for example, when it is sorted) and to resize the control when the cell height and width changes, select Move and size with cells.

 Note    This option is not available for Form controls.

    1. To make the control stay with a cell when the cell moves (for example, when the range or table that contains the cell is sorted), but keep the control's size independent of the changes to the cell's height and width, select Move but don't size with cells.
    2. To keep the control's position and size independent of the changes to the cell's position, height, and width, select Don't move or size with cells.

 Notes 

  • The underlying cell is determined by the location of the upper leftmost corner of the control.
  • Make sure that Cut, copy, and sort inserted objects with their parent cells option is set in the Excel Options dialog box. Click the Microsoft Office Button , click Excel Options and then, in the Advanced category, under Cut, copy, and paste, select the Cut, copy, and sort inserted objects with their parent cells check box.
  • If you want controls to be sorted and filtered with their underlying cells, for best results, use ActiveX controls and fit the control to the exact height and width of the underlying cell. (Press ALT when you move and size the cell.)
  • A control cannot be moved with its underlying cell if the control is locked and if the worksheet on which it is located is protected. For more information, see the See Also section.


See Also

 

 

Excel > Forms

Print a control on a worksheet

Excel 2007

You may want to print a control because it contains data or images that you want to include on a printed document.

  1. If one or more controls is an ActiveX control:
    1. Make sure that the Developer tab is available.

Display the Developer tab

      1. Click the Microsoft Office Button , and then click Excel Options.
      2. 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. Make sure that you are in design mode. On the Developer tab, in the Controls group, turn on Design Mode .
  1. Select the control or controls that you want to print.

For more information, see Select or deselect controls on a worksheet.

  1. Right-click the selection, click Format Control, and then click the Properties tab.
  2. Select Print object.


See Also

 

 

Excel > Forms

Protect controls and linked cells on a worksheet

Excel 2007

You may want to add protection to Form controls and ActiveX controls to prevent users from moving, changing, or deleting controls.

  1. If one or more controls is an ActiveX control:
    1. Make sure that the Developer tab is available.

Display the Developer tab

      1. Click the Microsoft Office Button , and then click Excel Options.
      2. 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. Make sure that you are in design mode. On the Developer tab, in the Controls group, turn on Design Mode .
  1. Select the control that you want to protect.

For more information, see Select or deselect controls on a worksheet.

  1. To prevent a user from moving, sizing, or deleting a control, right-click the selection, and then click Format Control.
  2. On the Protection tab, select the Locked check box.
  3. If the control has a linked cell, unlock the cell so that the control can write to it, and then hide the cell so that a user cannot cause unexpected problems by modifying the current value. To unlock the cell:
    1. On the Home tab, in the Cells group, click Format, and then click Format Control.

    1. On the Protection tab, clear the Locked check box, and then click OK.

Then, hide the column or row that contains the linked cell, or move the contents of the linked cell to a separate worksheet, and then hide that worksheet.

For more information, see Hide or display rows and columns and Hide or display worksheets or workbooks.

  1. To prevent users from changing the protections on the cells and controls that you have set, protect both the worksheet and the workbook.

For more information, see Protect worksheet or workbook elements.


See Also

 

 

Excel > Forms

Resize or format a control on a worksheet

Excel 2007

To create a professional looking appearance for a worksheet form, you should provide a consistent format to all controls and objects, and size them appropriately.

What do you want to do?

Resize a control

Format an ActiveX control

Format the colors and lines of a Form control check box or option button

Format the font, margins, and alignment of a Form control button

Format a Form control so that it has a 3-D appearance

Resize a control

You can resize a control by dragging its sizing handles or by entering measurements in the Format Control dialog box.

  1. If one or more controls is an ActiveX control:
    1. Make sure that the Developer tab is available.

Display the Developer tab

      1. Click the Microsoft Office Button , and then click Excel Options.
      2. 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. Make sure that you are in design mode. On the Developer tab, in the Controls group, turn on Design Mode .
  1. Select the control that you want to resize.

For more information, see Select or deselect controls on a worksheet.

  1. Do one of the following:

Resize by using the sizing handles  

    1. Position the pointer over one of the handles (sizing handle: One of the small circles or squares that appears at the corners and sides of a selected object. You drag these handles to change the size of the object.).

    1. Do one of the following:
      1. To increase or decrease the size in one or more directions, drag the mouse away from or toward the center.
      2. To keep the center of a control in the same place, hold down CTRL while you drag the mouse.
      3. To maintain the control's proportions, hold down SHIFT while you drag the mouse.
      4. To maintain the proportions while keeping the center in the same place, hold down CTRL and SHIFT while you drag the mouse.
    2. Release the mouse, and then release CTRL or SHIFT.

Resize by entering measurements  

    1. Right-click the selection, and then click Format Control.
    2. On the Size tab, enter measurements for the height and width of the control, or click the up or down arrow keys to move the height and width.
    3. To maintain the control's proportions, select the Lock aspect ratio check box.

 Note    The Reset button (which resets the original height and width), the Rotation text box, and the Relative to original picture size check box are not available.

 Top of Page

Format an ActiveX control

  1. If one or more controls is an ActiveX control:
    1. Make sure that the Developer tab is available.

Display the Developer tab

      1. Click the Microsoft Office Button , and then click Excel Options.
      2. 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. Make sure that you are in design mode. On the Developer tab, in the Controls group, turn on Design Mode .
  1. Select the control that you want to format.

For more information, see Select or deselect controls on a worksheet.

  1. To set the format properties for the control, on the Developer tab, in the Controls group, click Properties .

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

The Properties dialog box appears. For detailed information about each format 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 format properties that are available.

Summary of formatting properties

 Note    Each ActiveX control has a different subset of the following formatting properties.

If you want to specify

Use this property

The foreground color.

ForeColor (Form)

The background color.

BackColor (Form)

The background style (transparent or opaque).

BackStyle (Form)

The color of the border.

BorderColor (Form)

The type of border (none or single-line).

BorderStyle (Form)

Whether the control has a shadow.

Shadow (Excel)

The visual appearance of the border (flat, raised, sunken, etched, or bump).

SpecialEffect (Form)

 Top of Page

Format the colors and lines of a Form control check box or option button

  1. Select the control that you want to format.

For more information, see Select or deselect controls on a worksheet.

  1. Right-click the selection, and then click Format Control.
  2. On the Colors and Lines tab, do one or more of the following:
    • To change the color, select a color from the Color list box.
    • To find more colors, create your own colors, or adjust transparency, click More Colors.
    • To adjust the gradient, texture, and pattern, or add a picture, click Fill Effects.

 Top of Page

Format the font, margins, and alignment of a Form control button

  1. Select the control that you want to format.

For more information, see Select or deselect controls on a worksheet.

  1. Right-click the selection, and then click Format Control.
  2. On the Font tab, select the font type, font style, font size, other formatting options for the selected text.

For the Size value, you can type any number between 1 and 1638. The sizes available in the Size list depend on the selected font and the active printer. Select the Normal Font check box to reset the font, font style, size, and effects to the Normal (default) style.

  1. Click OK.
  2. Right-click the selection, and then click Format Control.
  3. On the Alignment tab, select the text alignment, direction, and orientation options that you want, and then click OK.
  4. Right-click the selection, and then click Format Control.
  5. On the Margins tab, select the internal margin options that you want, and then click OK.

 Top of Page

Format a Form control so that it has a 3-D appearance

 Note    Because the Form label control cannot be formatted to appear with 3-D shading, and the Form button control can appear only with 3-D shading, the 3-D shading check box is not available for either control in the Format Control dialog box.

  1. Select the control that you want to format.

For more information, see Select or deselect controls on a worksheet.

  1. Right click the selection, and then click Format Control.
  2. On the Control tab, click 3-D shading.

 Top of Page


See Also

 

 

Excel > Forms

Select or deselect controls on a worksheet

Excel 2007

To work with controls on a worksheet form  for example, to group, copy, resize, or format them  you must first select the controls or cancel the selection. There are several ways to do both.

 Note    You cannot combine Form controls or ActiveX controls with Drawing Tools or SmartArt Tools objects (such as Shapes and SmartArt graphics) in the same group selection.

What do you want to do?

Select a single control that is not contained in a group

Select multiple controls that are not contained in a group

Select a single control in a group

Select multiple controls in a group

Select a group that contains controls

Select hidden or stacked controls

Select controls and objects that are on the drawing layer

Cancel the selection of one or more controls

Select a single control that is not contained in a group

  • If one or more controls is an ActiveX control:
    1. Make sure that the Developer tab is available.

Display the Developer tab

      1. Click the Microsoft Office Button , and then click Excel Options.
      2. 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. Make sure that you are in design mode. On the Developer tab, in the Controls group, turn on Design Mode .
  • Click the selection border of the control.

The control border for a Form control appears as a dotted pattern and a series of sizing handles:

The control border for an ActiveX control appears as a series of sizing handles:

 Top of Page

Select multiple controls that are not contained in a group

There are several ways to select multiple controls that are not contained in a group.

Use the mouse

  1. If one or more controls is an ActiveX control:
    1. Make sure that the Developer tab is available.

Display the Developer tab

      1. Click the Microsoft Office Button , and then click Excel Options.
      2. 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. Make sure that you are in design mode. On the Developer tab, in the Controls group, turn on Design Mode .
  1. To select multiple controls one control at a time, hold down CTRL while you click each control.

Use the Selection Pane

You may find that the Selection Pane makes it easier to select one or more objects, and to show, hide, or change the order of objects.

  1. If one or more controls is an ActiveX control:
    1. Make sure that the Developer tab is available.

Display the Developer tab

      1. Click the Microsoft Office Button , and then click Excel Options.
      2. 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. Make sure that you are in design mode. On the Developer tab, in the Controls group, turn on Design Mode .
  1. On the Home tab, in the Editing group, click Find & Select.
  2. Do one of the following:
    1. To select objects that are hidden, stacked, or behind text, click Select Objects, and then draw a box over the objects.
    2. To open a task pane where you can select, multiselect, show, hide, or change the order of objects, click Selection Pane, and then click the options that you want.

 Top of Page

Select a single control in a group

  1. If one or more controls is an ActiveX control:
    1. Make sure that the Developer tab is available.

Display the Developer tab

      1. Click the Microsoft Office Button , and then click Excel Options.
      2. 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. Make sure that you are in design mode. On the Developer tab, in the Controls group, turn on Design Mode .
  1. Click the selection border of the group (group: A collection of objects that behave as one for the purpose of moving, resizing, or rotating them. A group can be composed of multiple sets of groups.).

The group selection border appears as a series of sizing handles:

  1. Click the control that you want to select inside the group.

 Top of Page

Select multiple controls in a group

  1. If one or more controls is an ActiveX control:
    1. Make sure that the Developer tab is available.

Display the Developer tab

      1. Click the Microsoft Office Button , and then click Excel Options.
      2. 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. Make sure that you are in design mode. On the Developer tab, in the Controls group, turn on Design Mode .
  1. Click the selection border of the group (group: A collection of objects that behave as one for the purpose of moving, resizing, or rotating them. A group can be composed of multiple sets of groups.).

The group selection border appears as a series of sizing handles:

  1. Hold down CTRL while you click the controls that you want to select.

 Top of Page

Select a group that contains controls

  • If one or more controls is an ActiveX control:
    1. Make sure that the Developer tab is available.

Display the Developer tab

      1. Click the Microsoft Office Button , and then click Excel Options.
      2. 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.

The group selection border appears as a series of sizing handles:

 Top of Page

Select hidden or stacked controls

To select a control that is hidden or under other controls:

  1. If one or more controls is an ActiveX control:
    1. Make sure that the Developer tab is available.

Display the Developer tab

      1. Click the Microsoft Office Button , and then click Excel Options.
      2. 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. Make sure that you are in design mode. On the Developer tab, in the Controls group, turn on Design Mode .
  1. Select the control that is on the top layer.
  2. Press TAB to cycle forward or SHIFT+TAB to cycle backward through the controls.

 Top of Page

Select controls and objects that are on the drawing layer

  • If one or more controls is an ActiveX control:
    1. Make sure that the Developer tab is available.

Display the Developer tab

      1. Click the Microsoft Office Button , and then click Excel Options.
      2. 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. Make sure that you are in design mode. On the Developer tab, in the Controls group, turn on Design Mode .
  • On the Home tab, in the Editing group, click Find & Select, and then do one of the following:
    1. Click Select Objects, and then use the mouse pointer to draw a rectangle around the objects that you want to select.
    2. Click Selection Pane, and then use the pane to select one or more objects.

 Top of Page

Cancel the selection of one or more controls

  1. If one or more controls is an ActiveX control:
    1. Make sure that the Developer tab is available.

Display the Developer tab

      1. Click the Microsoft Office Button , and then click Excel Options.
      2. 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. Make sure that you are in design mode. On the Developer tab, in the Controls group, turn on Design Mode .
  1. Do one of the following:
    1. To cancel the selection of one or more controls, click anywhere outside the control, set of selected controls, or group border.
    2. To cancel the selection of one control at a time in a set of selected controls, hold down CTRL and click the control.

 Top of Page


See Also

 

 

Excel > Forms

What can I do if I can't see or edit a cell because a control or object covers it?

Excel 2007

Symptom

Form controls, ActiveX controls, and other controls or objects obscure cells, which makes it difficult to see or edit the values in those cells.

Cause

Microsoft Office Excel always places controls and objects on the drawing canvas (drawing canvas: An area on which you can draw multiple shapes. Because the shapes are contained within the drawing canvas, they can be moved and resized as a unit.), which is a hidden layer that exists above the cell grid on the worksheet.

Resolution

You can do the following:

  • Move the control or object to a different location, either temporarily or permanently.

For more information, see Group, copy, move, or align controls on a worksheet.

Display the formula bar


See Also

 

 

Excel > Forms

Why are form-related commands or controls on the ribbon disabled?

Symptoms

You try to add a Form control or an ActiveX control to your worksheet, but the commands in the Controls group on the Developer tab or a specific control command button that should be available from the Insert command are disabled.

Cause and Resolution

There are several reasons for this:

  • The following controls are unavailable in Excel workbooks, and therefore always appear dimmed. These controls are only used with Excel version 5.0 dialog sheets:

Button

Name

Text Field

Combo List - Edit

Combo Drop - Down Edit

Run Dialog

  • Excel might currently be in data entry mode for a cell, which makes the Insert command unavailable. You might have unintentionally entered data entry mode for a cell that is obscured by a control, or the gridlines are hidden and you cannot easily see that the cell is in data entry mode.

To resolve this, press ESC to exit cell data entry mode.

  • You might have set Disable all controls without notification in the ActiveX settings for all applications section of the Trust Center.

To resolve this, use a less-restrictive setting.

  • You might be trying to add an ActiveX control in a document that was signed by an untrusted publisher.
  • The Properties command is never enabled for the Label , Button , and Group box form controls.
  • The Properties and View Code commands are disabled if Excel is not in Design mode and you have activated the ActiveX control.

 

 

Excel > Forms

Why can't I select form and ActiveX controls?

Excel 2007

Symptoms

Selecting a control is sometimes difficult and unpredictable.

Cause

There can be several reasons for this:

  • Because a Form control can contain text or other objects (such as an image), when you try to select the control, you might not be selecting the entire control if you do not position the pointer precisely on the control border.
  • Because Excel is not in Design mode, when you try to select an ActiveX control, you might unintentionally start an action, such as running a macro or selecting a check box.
  • Many controls are positioned close to each other.

Resolution

First, determine the type of control that you want to select. Because there are three different types of controls and objects that you can modify uniquely, you may not know for sure which type of control it is just by looking at it. To determine the type of control you are working with, right-click the control, and then note the following:

  • If the shortcut menu contains the command Properties, the control is an ActiveX control, and Excel is in Design mode.
  • If the shortcut menu contains the command Assign Macro, the control is a Form control.

Tip  To display the correct shortcut menu for a group box Form control, make sure that you select the perimeter of the group box, and not the interior of the group box.

  • If the shortcut menu contains the command Edit Text, the object is a Drawing Tools object.

Then, do the following:

  • For a Form control, do the following:
    • Make sure that the control border, which has a dotted pattern, is displayed:

Instead of the text border, which has a hatched pattern:

.

    • Use the following procedure to select the entire control:
      1. Right-click the control, but do not click a command on the shortcut menu.
      2. Press ESC.
  • For an ActiveX control:
    • If the Developer tab is not available, display it.

Display the Developer tab

      1. Click the Microsoft Office Button , and then click Excel Options.
      2. 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.

    • Make sure that Excel is in Design mode. On the Developer tab, in the Controls group, turn on Design Mode .
  • When you work with many controls that are positioned close to each other, zoom to a larger size to magnify the view.

For more information, see Zoom in or out of a document, presentation, or worksheet.


See Also

 

Microsoft® and Microsoft Excel® are registered trademarks of Microsoft Corporation.
©2003-2011 LikeOffice -
Privacy Policy - Contact us

[Top]