Renaming, Reordering, and Grouping Shapes in Excel 2007 and 2010
Shapes can add visual impact and function to your worksheets. Shapes allow you to direct the attention of a user, hyperlink to other parts of your workbook, and even run a Visual Basic code. These three ways to change shapes will help you increase the readability of your worksheet in Excel.
- Renaming shapes is often necessary for clarity and organization. Excel will name your shapes for you with names such as Rectangle 1 or Right Arrow 7.
- Reordering shapes is necessary for coding shapes with Visual Basic. When shapes are ordered in the order they are made, manipulating them using Visual Basic is tricky.
- Adding shapes to groups so that they can be moved and changed as a single item allows changes to be made to many shapes more efficiently.
Renaming shapes allows the user (you!) to more easily identify shapes and write Visual Basic code for those shapes.
There are two ways of renaming shapes: through selecting the shape and through the selection pane.
1. Selecting the Shape
Select a shape in your workbook. The name of that shape appears in the box to the left of the formula bar as shown in Figure 2 (you can see my shape is called "Montana").
To change the name, simply rename it in the box in the upper left and click Enter or Return to confirm it.
2. The Selection Pane
- To access the Selection Pane, first, select a shape
- Navigate to the Drawing Tools group of tabs and select the Format tab
- In the Arrange group on that tab, select the Selection Pane button
- This will open the pane to show you all the shapes on the active sheet, as seen in Figure 3.
- From here, you can rename any of the shapes by clicking on the name and then making changes.
The list of shapes is not an alphabetic list, shapes are listed in the order they were created. The list of shapes will not re-sort itself automatically.
When you rename shapes in Excel, they remain in the order that they were created. This makes it difficult to use the shapes in a Visual Basic script.
The U.S. Map Example
My thematic chart of the United States uses Visual Basic code that pulls data from an external website and changes the fill color of the shape representing each state based on the data provided.
The data provided lists the states in alphabetical order. If the shapes are not also in alphabetical order, the thematic chart will not accurately represent the data. Figure 3 shows the states out of alphabetical order, and, thus, misrepresenting data pulled from the external site.
Key to Arranging Shapes in Excel
First Menu Option
Second Menu Option
Bring to Front
Bring to Front
Shape is moved to the very top of the list
Shape is moved one place higher
Send to Back
Send to Back
Shape sent to the very bottom of the list
Shape moves one place lower
Reordering Shapes Using the Selection Pane
- Select a shape you want to re-order
- Right-click on the shape in the worksheet
- The two options you will need to use to move the shape are Bring to Front and Send to Back, as seen in Figure 4.
- Figure 5 shows that my shapes are ordered in reverse alphabetical order. The states are now listed in the same order as my data.
Now when I run my Visual Basic macro, I get a thematic chart that is consistent with the data provided from the external source per Figure 5 and Figure 6.
How to Group and Ungroup Shapes
Grouping shapes allows for multiple changes made to many shapes at once. Moving shapes in a group keeps them in the same position relative to one another. There are two ways to group shapes:
1. Grouping Shapes By Selection
- Select all the shapes you want to place in the group
- Right-click and select Group and to group
2. Grouping Shapes Using the Format and Arrange Tab
- Select the Format tab which is part of Drawing Tools. Click the Group button which is in the Arrange group
- To ungroup a group of shapes, repeat the above steps but select Ungroup rather than Group.
Figure 7 shows a group of shapes called Group 12. The group as a whole can be selected and the properties of all shapes in the group configured. The whole group can be moved by selecting it.
Ungroup, Reselect, and Rename Shapes
If you're concerned about the ability to ungroup and reselect single shapes in your worksheet, never fear:
- If these shapes were part of a previous group, there will also be an option to regroup.
- You can rename the group in exactly the same way you rename a shape.
- Should you want to change a single shape within the group, select the group and then click on an individual shape to change its individual properties. This is shown in Figure 8.
Shapes are very useful and versatile elements for making spreadsheets with visual impact. Shapes allow users to navigate around your workbook using hyperlinks, or run code at the click of a button.
I hope you found this article useful and informative. Please leave any comments, questions, or concerns below.
This article is accurate and true to the best of the author’s knowledge. Content is for informational or entertainment purposes only and does not substitute for personal counsel or professional advice in business, financial, legal, or technical matters.
© 2013 Robbie C Wilson