NativeExcel2 for .Net Developer's Reference

IRange.GroupMethod

Increases the outline level of rows in the specifed range.

[Visual Basic]
SubGroup()
[C#]
voidGroup();
[C++]
voidGroup();
[JScript]
functionGroup();

Example

This example groups three first rows on sheet one.

[C#]
 book.Worksheets[1].Range["A1:A3"].Group();
[VisualBasic]
 book.Worksheets(1).Range("A1:A3").Group()
[C++]
 book->Worksheets->Item[1]->Range->Item[S"A1:A3"]->Group();
This example is the same as the previous.
[C#]
 book.Worksheets[1].Range["A1:A3"].Rows.Group();
[VisualBasic]
 book.Worksheets(1).Range("A1:A3").Rows.Group()
[C++]
 book->Worksheets->Item[1]->Range->Item[S"A1:A3"]->Rows->Group();
This example groups three first columns on sheet one.
[C#]
 book.Worksheets[1].Range["A1:C1"].Columns.Group();
[VisualBasic]
 book.Worksheets(1).Range("A1:C1").Columns.Group()
[C++]
 book->Worksheets->Item[1]->Range->Item[S"A1:C1"]->Columns->Group();

See Also

IRange Interface | NativeExcel Namespace | IRangeColumns.Group Method | Ungroup Method | OutlineLevel Property | IRangeColumns.OutlineLevel Property | ClearOutline Method