AutoOutline Method Example
This example creates an outline for the range A1:G37 on Sheet1. The range must contain either a summary row or a summary column.
Worksheets("Sheet1").Range("A1:G37").AutoOutline