NativeExcel2 for .Net Developer's Reference

IRangeColumns.Item Property (Int32, Int32)

Returns IRangeColums interface that represents a subsequence or columns.

[C#] In C#, this property is the indexer for the IRangeColumns class.

[Visual Basic]
DefaultPropertyReadOnlyItem(_
ByValFirstColAsInteger,_
ByValLastColAsInteger_
)AsIRangeColumns
[C#]
IRangeColumnsthis[
intFirstCol,
intLastCol
]{get;}
[C++]
__propertyIRangeColumns*get_Item(
intFirstCol,
intLastCol
);
[JScript]
returnValue = IRangeColumnsObject.Item( FirstCol,LastCol );
-or-
returnValue = IRangeColumnsObject( FirstCol,LastCol );

[JScript] In JScript, you can use the default indexed properties defined by a type, but you cannot explicitly define your own. However, specifying the expando attribute on a class automatically provides a default indexed property whose type is Object and whose index type is String.

Parameters

FirstCol
The one-based index number of the first column
LastCol
The one-based index number of the last column

Property Value

Returns an IRangeColumns interface.

Example

This example sets the width of columns one through five on sheet one.

[C#]
 book.Worksheets[1].Cells.Columns[1,5].ColumnWidth = 20; 
[VisualBasic]
 book.Worksheets[1].Cells.Columns(1,5).ColumnWidth = 20
[C++]
 book->Worksheets->Item[1]->Cells->Columns->Item[1,5]->ColumnWidth = 20;

See Also

IRangeColumns Interface | NativeExcel Namespace | IRangeColumns.Item Overload List