Microsoft Office Tutorials and References
In Depth Information
18.2 Children of the Worksheet Object
The first step in obtaining the outline in Figure 18-4 is to set the properties of the Outline
object for this worksheet. The Outline property of the Worksheet object returns an
Outline object, so we begin with:
.SummaryRow = xlBelow
.AutomaticStyles = False
Setting the SummaryRow property to xlBelow tells Excel that our summary rows (the
subtotal and total rows) lie below the detailed data. Thus, Excel will place the
the appropriate rows.
Setting AutomaticStyles to False prevents Excel from tampering with our formatting.
Otherwise, Excel would remove the boldfacing on the summary rows.
For this, we use the Group method of the Range object. In particular, the following code
Note that the SummaryColumn property of the Outline object governs the location of the
expansion/contraction buttons when columns grouped.
To expand or collapse levels, the user can click the small numbered buttons at the top of
above X being completely expanded and all levels below and including X being
completely contracted. Thus, all rows at level X and above are made visible, but no levels
below X are visible.