Syncfusion.XlsIO.Base
Example 


Syncfusion.XlsIO Namespace > IRange Interface > Group Method : Group(ExcelGroupBy) Method
Represents to expand the group by rows/columns.

Group(ExcelGroupBy) Method

Groups the Range by row/column.
Syntax
'Declaration
 
Overloads Function Group( _
   ByVal groupBy As ExcelGroupBy _
) As IRange
'Usage
 
Dim instance As IRange
Dim groupBy As ExcelGroupBy
Dim value As IRange
 
value = instance.Group(groupBy)

Parameters

groupBy
Represents to expand the group by rows/columns.

Return Value

Returns the Range after grouping.
Example
The following code illustrates how to group the Range.
ExcelEngine excelEngine = new ExcelEngine();
IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Excel2013;
IWorkbook workbook = application.Workbooks.Open("Sample.xlsx");
IWorksheet worksheet = workbook.Worksheets[0];
    
//Group Rows
worksheet.Range["A4:A6"].Group(ExcelGroupBy.ByRows);
            
//Group Columns
worksheet.Range["C1:F1"].Group(ExcelGroupBy.ByColumns);
            
workbook.SaveAs("Grouping.xlsx");
workbook.Close();
excelEngine.Dispose();
AssemblyVersion

Syncfusion.XlsIO.Base: 17.2460.0.34

See Also