Returns the number of columns in the range.
[Visual Basic] Property ReadOnly Count As Integer [C#] int Count { get; } [C++] __property int get_Count(); [JScript] function get Count() : int
This example displays the number of columns in the selection on sheet one.
[C#]
IWorksheet sheet = book.Worksheets[1];
MessageBox.Show(String.Format("The selection contains {0} columns", sheet.Selection.Columns.Count));
[Visual Basic]
Dim sheet As IWorksheet = book.Worksheets(1)
MessageBox.Show(String.Format("The selection contains {0} columns", sheet.Selection.Columns.Count))
[C++]
IWorksheet* sheet = book->Worksheets->Item[1];
MessageBox::Show(String::Format(S"The selection contains {0} columns", sheet->Selection->Columns->Count));
IRangeColumns Interface | NativeExcel Namespace | IWorksheet.Selection Property | IRange.Columns Property