Work with Outlines
Outlining lets you quickly switch between the big picture and the details of a summary worksheet. In Figure 9-1, you can see the detail view of a summary worksheet, and in Figure 9-2 you can see the corresponding big picture.
You can control outlining programmatically by using the Outline property of a Worksheet object to return an Outline object. You can use the properties and methods of the Outline object to control how the outline is displayed and how levels are assigned.
The following code creates an AutoOutline and displays the outline levels:
ActiveSheet.UsedRange.AutoOutline ActiveSheet.Outline.AutomaticStyles = True ActiveSheet.Outline.ShowLevels 1, 1
If you have an outline with many levels, the following code displays all levels. An outline can have up to eight levels:
ActiveSheet.Outline.ShowLevels 8,8

Figure 9-1. A detail view of team sales

Figure 9-2. The corresponding big picture
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access