Syncfusion.XlsIO.Base
Example 


The number of rows (positive, negative, or 0 (zero)) by which the range is to be offset
The number of columns (positive, negative, or 0 (zero)) by which the range is to be offset

Offset Method

Returns a IRange object that represents a range that�s offset from the specified range.
Syntax
'Declaration
 
Function Offset( _
   ByVal rowOffset As Integer, _
   ByVal columnOffset As Integer _
) As IRange
'Usage
 
Dim instance As IRange
Dim rowOffset As Integer
Dim columnOffset As Integer
Dim value As IRange
 
value = instance.Offset(rowOffset, columnOffset)

Parameters

rowOffset
The number of rows (positive, negative, or 0 (zero)) by which the range is to be offset
columnOffset
The number of columns (positive, negative, or 0 (zero)) by which the range is to be offset

Return Value

Returns a range which is shifted by the specified number of rows and columns.
Remarks
Use the Offset method to access the cell range of the same size as the current range which is shifted by the specified number of rows and columns.
Example
using Syncfusion.XlsIO;
            
class Example
{
 static void Main()
 {
   using(ExcelEngine engine = new ExcelEngine())
   {
      IApplication application = engine.Excel;
      application.DefaultVersion = ExcelVersion.Excel2013;
      IWorkbook workbook = application.Workbooks.Open(Sample.xlsx);
      IWorksheet worksheet = workbook.Worksheets[0];
      IRange range = worksheet.Range[5,6];
      var offset = range.Offset(-3,-1);
      var address2 = offset.AddressLocal;
      workbook.SaveAs("output.xlsx");
   }
 }
}
AssemblyVersion

Syncfusion.XlsIO.Base: 17.1460.0.32

See Also