ShowLevels Method

Microsoft Excel Visual Basic

Displays the specified number of row and/or column levels of an outline.

expression.ShowLevels(RowLevels, ColumnLevels)

expression    Required. An expression that returns an Outline object.

RowLevels    Optional Variant. Specifies the number of row levels of an outline to display. If the outline has fewer levels than the number specified, Microsoft Excel displays all the levels. If this argument is 0 (zero) or is omitted, no action is taken on rows.

ColumnLevels    Optional Variant. Specifies the number of column levels of an outline to display. If the outline has fewer levels than the number specified, Microsoft Excel displays all the levels. If this argument is 0 (zero) or is omitted, no action is taken on columns.

Remarks

You must specify at least one argument.

Example

This example displays row levels one through three and column level one of the outline on Sheet1.

Worksheets("Sheet1").Outline _
    .ShowLevels rowLevels:=3, columnLevels:=1