Class Outline (Excel VBA)

The class Outline represents an outline on a worksheet.

AutomaticStyles

True if the outline uses automatic styles.

Worksheets("Sheet1").Outline.AutomaticStyles = True

Parent

Returns the parent object for the specified object. Read-only.

ShowLevels

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

You must specify at least one argument.

Syntax : expression.ShowLevels (RowLevels, ColumnLevels)

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

Arguments

The following arguments are optional

RowLevels (Long) - 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 (Long) - Specifies the number of column levels of an outline to display. If the outline has fewer levels than the number specified, Excel displays all the levels. If this argument is 0 (zero) or is omitted, no action is taken on columns.

SummaryColumn

Returns or sets the location of the summary columns in the outline.

Possible Values are xlSummaryOnLeft - The summary column will be positioned to the left of the detail columns in the outline, xlSummaryOnRight - The summary column will be positioned to the right of the detail columns in the outline.
Worksheets("Sheet1").Activate 
Selection.AutoOutline 
With ActiveSheet.Outline 
 .SummaryRow = xlAbove 
 .SummaryColumn = xlRight 
 .AutomaticStyles = True 
End With

SummaryRow

Returns or sets the location of the summary rows in the outline.

Possible Values are xlSummaryAbove - The summary row will be positioned above the detail rows in the outline, xlSummaryBelow - The summary row will be positioned below the detail rows in the outline.

Set XlSummaryRow to xlAbove for Microsoft Word-style outlines, where category headers are above the detailed information. Set XlSummaryRow to xlBelow for accounting-style outlines, where summations are below the detailed information.

Worksheets("Sheet1").Activate 
Selection.AutoOutline 
With ActiveSheet.Outline 
 .SummaryRow = xlAbove 
 .SummaryColumn = xlRight 
 .AutomaticStyles = True 
End With