See Also

IRange Interface  | IRange Members  | AutoFit Method  | Count Property  | Rows Property  | RowCount Property  | ColumnCount Property

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Language

Visual Basic

C#

C++

C++/CLI

Show All

See Also Languages SpreadsheetGear The Performance Spreadsheet Component Company 

Columns Property

SpreadsheetGear Namespace > IRange Interface : Columns Property

Returns a new instance of IRange which represents the same range of cells but which may be used to determine the number of columns in the range or to AutoFit the columns in the range.

[Visual Basic]
Overridable ReadOnly Property Columns As IRange
[C#]
virtual IRange Columns {get;}
[C++]
__property virtual IRange* get_Columns();
[C++/CLI]
virtual property IRange^ Columns {    IRange^ get(); }

Remarks

If the IRange represents more than one range of cells, only the first range of cells is represented in the new IRange.

Example

[C#] 

int numberOfCols = worksheet.Cells["A1:B3"].Columns.Count; // 2 columns 
    

[Visual Basic] 

Dim numberOfCols As Integer = worksheet.Cells("A1:B3").Columns.Count ' 2 columns

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

IRange Interface  | IRange Members  | AutoFit Method  | Count Property  | Rows Property  | RowCount Property  | ColumnCount Property

 

 


See our live Excel Reporting, Excel Charting, Excel to DataGrid and Excel Calculation Samples.

Copyright © 2003-2007 SpreadsheetGear LLC. All Rights Reserved.

SpreadsheetGear and Spreadsheet Gear are trademarks of SpreadsheetGear LLC.