Working with Graphic Objects

Besides all the nifty formatting options for graphics that are built into Excel 2010, there are also tools you can use to select and arrange graphic objects, group and hide them, move them around, and protect them.

image with no caption

Sometimes you’ll find it convenient to move, resize, or even reformat more than one object at a time. If you create a logo using multiple objects, for example, you want to move the objects as a single unit, preserving their positions relative to one another. For these purposes, Excel includes the Group button, located in the Arrange group on the Page Layout tab. This button is a menu containing the Group, Ungroup, and Regroup commands, and it remains inactive unless more than one object is selected. (The Group button can also be found on the Format tab that appears when an object is selected.)

After you select a group of objects, you can lock them together by using the Group button on the Page Layout tab or by right-clicking any of the selected objects, clicking Group, and then clicking one of the Group commands, as shown in Figure 10-46.

When you group objects, the sets of handles around each selected object are replaced by a single set of handles for the entire group, as shown in Figure 10-46. After you group the objects, you can manipulate the set of objects as a single object. You can resize, move, and apply formatting to them as a group. When you apply formatting, however, the separate objects might behave differently, especially if you have grouped different kinds of objects with different formats. It’s best to apply formatting before you group objects, unless the objects are similar.

To ungroup a set of objects, select the group, right-click, and then click Group, Ungroup. You can use the Regroup command to reconstitute the group of objects you most recently ungrouped. This is handy, for example, if you ungrouped a set of objects to make changes to one or more of them. Rather than selecting them again and clicking Group, just click Regroup.

image with no caption
image with no caption

Think of the objects on a worksheet as stacked on top of each other. Each new object you draw is placed on top of the stack. If necessary, you can adjust the position of objects in the stack by using the Bring Forward and Send Backward buttons in the Arrange group on the Page Layout tab. (You can also right-click an object and then use the equivalent commands on the shortcut menu.)

Figure 10-47 shows two sets of ungrouped objects. The set on the right was originally just like the set on the left, but then we selected the banner and clicked Bring Forward, Bring To Front, and then we selected the star and clicked Send Backward, Send To Back.

As you can see in Figure 10-47, the Send Backward button is both a menu and a button—clicking the main part of the button issues the Send Backward command, while clicking its arrow displays a short menu. The same is true for the Bring Forward button. The Bring Forward and Send Backward commands move the object one step at a time through the stack, while the Bring To Front and Send To Back commands move the object all the way forward or back with a single click.

image with no caption

If you need to work with multiple objects on a worksheet, you can gain a little more control using the selection pane. Click the Selection Pane button in the Arrange group on the Page Layout tab to display a task pane like the one shown in Figure 10-48.

You can use the buttons at the bottom of the Selection And Visibility task pane to show and hide all objects on the worksheet and to move selected objects up and down in the object stack. You can click the little eyeball icon to the right of an object name to hide that object; click again to unhide it. You can also edit the names of the objects by simply clicking the name once to select it and then clicking it again to edit its text. It is important to note that hidden objects continue to appear on the list in the selection pane, which is one of the only ways you can tell they are there.

You can change the relationship of objects to the underlying worksheet by using the options on the Properties tab in the Format Shape dialog box. To do so, right-click an object, click Format Shape, and click Properties to display the dialog box shown in Figure 10-49. (You’ll find a similar command when you right-click pictures or embedded objects.)

The default Object Positioning option is Move And Size With Cells, meaning that if you do anything to change the size or shape of the underlying cells, the object adjusts accordingly. An underlying cell is any cell whose right or bottom border is between the upper-left corner and the lower-right corner of the object. Here are some facts you need to know about the Object Positioning options:

The Size tab in the Format Shape dialog box offers precise control over the height, width, angle of rotation, scale, and cropping of the selected object. You can perform these tasks directly by dragging, but you might find it helpful to display the dialog box if you want to resize objects proportionally using the Lock Aspect Ratio option.

image with no caption

It’s great to be able to create cool graphics with Excel, but the free-floating nature of graphic objects sometimes makes it hard to maintain a semblance of order on your worksheet. The Align button, in the Arrange group on the Page Layout tab, contains commands you can use to straighten up your worksheet, as shown in Figure 10-50.

Suppose you have a number of objects that you want to be evenly spaced, like the randomly spaced boxes shown on the left in Figure 10-50. You can start by selecting the top row of objects, using the Align Top command to line them up, and then selecting Distribute Horizontally to space them evenly. Then you can use the other alignment and distribution commands to position the rest of the objects to your liking. Here are some key points to remember about using these object-positioning commands:

Objects are ordinarily prevented from being selected, moved, formatted, or sized when you apply protection to a worksheet (Review tab, Protect Sheet). You can change this before applying sheet protection by right-clicking the object, clicking the Format Shape (or Format Picture) command, and then selecting or clearing the Locked check box on the Properties tab. (Refer to Figure 10-49.) You can also select the Lock Text check box, which is available only when you select a text-capable object, to protect an object’s text contents. Newly drawn objects are assigned Locked status. Remember, to activate worksheet security and protection, you must also click Protect Sheet on the Review tab. For more information about protection, see Protecting Worksheets on page 170.