SpreadsheetGear 2023
Cells Property (IRange)
Example 


SpreadsheetGear Namespace > IRange Interface : Cells Property
Returns the cells represented by this instance of IRange.
Syntax
'Declaration
 
ReadOnly Property Cells As IRange
'Usage
 
Dim instance As IRange
Dim value As IRange
 
value = instance.Cells
IRange Cells {get;}
Example
class Program
{
    static void Main()
    {
        // Create a worksheet.
        SpreadsheetGear.IWorksheet worksheet = 
            SpreadsheetGear.Factory.GetWorkbook().Worksheets["Sheet1"];
 
        // Writes "6" (two columns by three rows).
        System.Console.WriteLine(worksheet.Cells["B3:C5"].Count);
 
        // Writes "2" (two columns).
        System.Console.WriteLine(worksheet.Cells["B3:C5"].Columns.Count);
 
        // Writes "6" (back to two columns by three rows).
        System.Console.WriteLine(worksheet.Cells["B3:C5"].Columns.Cells.Count);
    }
}
Class Program
    Shared Sub Main()
        ' Create a worksheet.
        Dim worksheet As SpreadsheetGear.IWorksheet = SpreadsheetGear.Factory.GetWorkbook().Worksheets("Sheet1")
 
        ' Writes "6" (two columns by three rows).
        System.Console.WriteLine(worksheet.Cells("B3:C5").Count)
 
        ' Writes "2" (two columns).
        System.Console.WriteLine(worksheet.Cells("B3:C5").Columns.Count)
 
        ' Writes "6" (back to two columns by three rows).
        System.Console.WriteLine(worksheet.Cells("B3:C5").Columns.Cells.Count)
    End Sub 'Main
End Class 'Program
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

IRange Interface
IRange Members