NativeExcel for .Net Developer's Reference

IRangeColumns Interface

Represents a collection of columns.

For a list of all members of this type, see IRangeColumns Members.

[Visual Basic]
Public Interface IRangeColumns
    Implements IRange, IEnumerable
[C#]
public interface IRangeColumns : IRange, IEnumerable
[C++]
public __gc __interface IRangeColumns : public IRange, IEnumerable
[JScript]
public interface IRangeColumns extends IRange, IEnumerable

Remarks

Use the IRange.Columns, IRange.EntireColumn properties to return the IRangeColumns interface.

Example

This example sets the font style in the second column of range A1:F10 to bold.

[C#]
 IRangeColumns cols = book.Worksheets[1].Range["A1:F10"].Columns;
 cols[2].Font.Bold = true;
[Visual Basic]
 Dim cols As IRangeColumns
 cols = book.Worksheets(1).Range("A1:F10").Columns
 cols(2).Font.Bold = True
[C++]
 IRangeColumns* cols = book->Worksheets->Item[1]->Range->Item[S"A1:F10"]->Columns;
 cols->Item[2]->Font->Bold = true;

This example copies the values from the second column of range A1:F10 to third.
[C#]
 IRangeColumns cols = book.Worksheets[1].Range["A1:F10"].Columns;
 cols[3].Value = cols[2].Value;
[Visual Basic]
 Dim cols As IRangeColumns
 cols = book.Worksheets(1).Range("A1:F10").Columns
 cols(3).Value = cols(2).Value
[C++]
 IRangeColumns* cols = book->Worksheets->Item[1]->Range->Item[S"A1:F10"]->Columns;
 cols->Item[3]->Value = cols->Item[2]->Value;

Requirements

Namespace: NativeExcel

Assembly: NativeExcel (in NativeExcel.dll)

See Also

IRangeColumns Members | NativeExcel Namespace | IRange.Columns Property | IRange.EntireColumn Property