Syncfusion.XlsIO.Base
Example 


Range to be intersected.

IntersectWith Method

Returns intersection of the Range with specified Range.
Syntax
'Declaration
 
Function IntersectWith( _
   ByVal range As IRange _
) As IRange
'Usage
 
Dim instance As IRange
Dim range As IRange
Dim value As IRange
 
value = instance.IntersectWith(range)
IRange IntersectWith( 
   IRange range
)

Parameters

range
Range to be intersected.

Return Value

Returns the intersection Range;if there is no intersection, NULL is returned.
Example
The following code illustrates how to perform intersectwith in the Range.
ExcelEngine excelEngine = new ExcelEngine();
IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Excel2013;
IWorkbook workbook = application.Workbooks.Create(1);
IWorksheet worksheet = workbook.Worksheets[0];
            
//Merging cells
IRange range = worksheet.Range["A16:C16"];
IRange commonRange = worksheet.Range["B16:D16"].IntersectWith(range);
workbook.SaveAs("Intersection.xlsx");
workbook.Close();
excelEngine.Dispose();
AssemblyVersion

Syncfusion.XlsIO.Base: 16.4460.0.40

See Also