SpreadsheetGear Namespace > IRange Interface : Count Property |
'Declaration
<System.ObsoleteAttribute("Use IRange.CellCount, IRange.RowCount or IRange.ColumnCount")> ReadOnly Property Count As System.Integer
'Usage
Dim instance As IRange Dim value As System.Integer value = instance.Count
[System.Obsolete("Use IRange.CellCount, IRange.RowCount or IRange.ColumnCount")] System.int Count {get;}
read-only property Count: System.Integer;
System.ObsoleteAttribute("Use IRange.CellCount, IRange.RowCount or IRange.ColumnCount") function get Count : System.int
[System.Obsolete("Use IRange.CellCount, IRange.RowCount or IRange.ColumnCount")] __property System.int get_Count();
[System.Obsolete("Use IRange.CellCount, IRange.RowCount or IRange.ColumnCount")] property System.int Count { System.int get(); }
int numberOfCells = worksheet.Cells["A1:B3"].Count; // 6 cells int numberOfRows = worksheet.Cells["A1:B3"].Rows.Count; // 3 rows int numberOfCols = worksheet.Cells["A1:B3"].Columns.Count; // 2 columns
Dim numberOfCells As Integer = worksheet.Cells("A1:B3").Count ' 6 cells Dim numberOfRows As Integer = worksheet.Cells("A1:B3").Rows.Count ' 3 rows Dim numberOfCols As Integer = worksheet.Cells("A1:B3").Columns.Count ' 2 columns
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