After you add Form and ActiveX controls to a worksheet form, you may want to group, copy, move, or align controls to create a well designed, user friendly form.
To perform any of the procedures in this article, if one or more controls is an ActiveX control, you must first make sure that the Developer tab is available.
Display the Developer tab
-
-
Click File > Options > Customize Ribbon.
-
Under Customize the Ribbon, click Main tabs from the dropdown list.
-
Select the Developer checkbox, and then click OK.
-
-
Make sure that you are in design mode. On the Developer tab, click Design Mode .
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 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.
Group controls
-
Select the controls that you want to group. For more information, see Select or deselect controls on a worksheet.
-
Right-click the selection, point to Grouping, and then click Group.
Ungroup controls
-
Select the group that you want to ungroup. For more information, see Select or deselect controls on a worksheet.
-
Right-click the selection, point to Grouping, and then click Ungroup.
-
To continue ungrouping, click Yes when the message box appears.
-
To change an individual control, continue to select and ungroup controls until the one that you want becomes available.
-
Regroup controls
-
Select any one of the controls that was previously grouped. For more information, see Select or deselect controls on a worksheet.
-
Right-click the selection, point to Grouping, and then click Regroup.
Copy one or more controls
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
-
Select the control or controls. For more information, see Select or deselect controls on a worksheet.
-
To make a single duplicate of a control, clickHome, click Copy , and then click Paste .
To make multiple duplicates, repeat pasting until you have the number of copies you want.
By using the keyboard and the mouse
-
Select the control or controls. For more information, see Select or deselect controls on a worksheet.
-
Press CTRL and drag the control.
To make multiple duplicates, repeat dragging until you have the number of copies that you want.
Move one or more controls
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
-
Select the control or controls. For more information, see Select or deselect controls on a worksheet.
-
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
-
Select the control or controls. For more information, see Select or deselect controls on a worksheet.
-
Press the arrow keys to move the control in single pixel increments.
Move a control forward or backward in the object stacking order
Controls and other objects on the drawing canvas 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.
-
Select the control. For more information, see Select or deselect controls on a worksheet.
-
Right-click the selection, point to Order, and then do the following:
-
To move the control one layer up in the stacking order, click Bring Forward.
-
To move the control to the top layer in the stacking order, click Bring to Front.
-
To move the control one layer down in the stacking order, click Send Backward.
-
To move the control to the bottom layer in the stacking order, clickSend to Back.
-
Align and distribute controls
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
-
Select the control. For more information, see Select or deselect controls on a worksheet.
-
To align all objects with the upper-left corner of a cell, the Drawing Tools Format tab, click the arrow next to Align , and then click Snap to Grid .
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, click the Drawing Tools Format tab, 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.
-
Select the controls. For more information, see Select or deselect controls on a worksheet.
-
To align the controls, click the Drawing Tools Format tab, and then click the arrow next to Align . Do one of the following:
-
To align the controls by the top-most control, click Align Top .
-
To align the controls by the bottom-most control, click Align Bottom .
-
To align the controls by the left-most control, click Align Left .
-
To align the controls by the right-most control, Align Right .
-
Align controls horizontally or vertically
-
Select the controls. For more information, see Select or deselect controls on a worksheet.
-
To align the controls, click the Drawing Tools Format tab, click the arrow next to Align , and then do one of the following:
-
To align controls horizontally through the middle of the controls, click Align Middle .
-
To align controls vertically through the centers of the controls, click Align Center .
-
Distribute controls horizontally or vertically
-
Select at least three controls. For more information, see Select or deselect controls on a worksheet.
-
To distribute the controls, click the Drawing Tools Format tab, click the arrow next to Align , and then do one of the following:
-
To evenly space controls horizontally, click Distribute Horizontally .
-
To evenly space controls vertically, click Distribute Vertically .
-
To perform any of the procedures in this article, if one or more controls is an ActiveX control, you must first make sure that the Developer tab is available.
Display the Developer tab
-
-
Click the Microsoft Office Button , and then click Excel Options.
-
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.
-
-
Make sure that you are in design mode. On the Developer tab, in the Controls group, turn on Design Mode .
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 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.
Group controls
-
Select the controls that you want to group. For more information, see Select or deselect controls on a worksheet.
-
Right-click the selection, point to Grouping, and then click Group.
Ungroup controls
-
Select the group that you want to ungroup. For more information, see Select or deselect controls on a worksheet.
-
Right-click the selection, point to Grouping, and then click Ungroup.
-
To continue ungrouping, click Yes when the message box appears.
-
To change an individual control, continue to select and ungroup controls until the one that you want becomes available.
-
Regroup controls
-
Select any one of the controls that was previously grouped. For more information, see Select or deselect controls on a worksheet.
-
Right-click the selection, point to Grouping, and then click Regroup.
Copy one or more controls
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
-
Select the control or controls. For more information, see Select or deselect controls on a worksheet.
-
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
-
Select the control or controls. For more information, see Select or deselect controls on a worksheet.
-
Press CTRL and drag the control.
To make multiple duplicates, repeat dragging until you have the number of copies that you want.
Move one or more controls
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
-
Select the control or controls. For more information, see Select or deselect controls on a worksheet.
-
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
-
Select the control or controls. For more information, see Select or deselect controls on a worksheet.
-
Press the arrow keys to move the control in single pixel increments.
Move a control forward or backward in the object stacking order
Controls and other objects on the drawing canvas 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.
-
Select the control. For more information, see Select or deselect controls on a worksheet.
-
Right-click the selection, point to Order, and then do the following:
-
To move the control one layer up in the stacking order, click Bring Forward.
-
To move the control to the top layer in the stacking order, click Bring to Front.
-
To move the control one layer down in the stacking order, click Send Backward.
-
To move the control to the bottom layer in the stacking order, clickSend to Back.
-
Align and distribute controls
Important: To do the following procedures, you must first 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
-
Click the arrow next to the Quick Access Toolbar, and then click More Commands.
-
Under Choose commands from, select All Commands.
-
In the list, select Align .
-
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
-
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 .
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.
-
Select the controls. For more information, see Select or deselect controls on a worksheet.
-
To align the controls, on the Quick Access Toolbar, click the arrow next to Align , and then do one of the following:
-
To align the controls by the top-most control, click Align Top .
-
To align the controls by the bottom-most control, click Align Bottom .
-
To align the controls by the left-most control, click Align Left .
-
To align the controls by the right-most control, Align Right .
-
Align controls horizontally or vertically
-
Select the controls. For more information, see Select or deselect controls on a worksheet.
-
To align the controls, on the Quick Access Toolbar, click the arrow next to Align , and then do one of the following:
-
To align controls horizontally through the middle of the controls, click Align Middle .
-
To align controls vertically through the centers of the controls, click Align Center .
-
Distribute controls horizontally or vertically
-
Select at least three controls. For more information, see Select or deselect controls on a worksheet.
-
To distribute the controls, on the Quick Access Toolbar, click the arrow next to Align , and then do one of the following:
-
To evenly space controls horizontally, click Distribute Horizontally .
-
To evenly space controls vertically, click Distribute Vertically .
-
No comments:
Post a Comment