Page 1
Show All
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.
Top of Page
2. On the Developer tab, in the Controls group, click Insert, and then under Form Controls, click
Button .
3. Click the worksheet location where you want the upper-left corner of the button to appear.
For more information about how to create and edit macros, see the Help section, Macros.
5. To specify the control properties of the button, right-click the button, and then click Format
Control.
Top of Page
2. On the Developer tab, in the Controls group, click Insert, and then under ActiveX Controls, click
Command Button .
3. Click the worksheet location where you want the upper-left corner of the command button to
appear.
4. To edit the ActiveX control, make sure that you are in design mode. On the Developer tab, in the
5. To specify the control properties of the command button, on the Developer tab, in the Controls
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 topic. You can also type the property name in the
Visual Basic Help Search box. The following table summarizes the properties that are available.
General:
Whether the control can receive focus and respond to user- Enabled (Form)
generated events.
The way the control is attached to the cells below it (free Placement (Excel)
floating, move but do not size, or move and size).
Text:
Font attributes (bold, italic, size, strikethrough, underline, Bold, Italic, Size, StrikeThrough,
and weight). Underline, Weight (Form)
Descriptive text on the control that identifies or describes it. Caption (Form)
The distance between the control and the left or top edge Left, Top (Form)
of the worksheet.
Formatting:
Image:
The location of the picture relative to its caption (left, top, PicturePosition (Form)
right, and so on).
The type of pointer that is displayed when the user MousePointer (Form)
positions the mouse over a particular object (standard,
arrow, I-beam, and so on).
Whether the control takes the focus when clicked. TakeFocusOnClick (Form)
Top of Page
See Also