Version

Columns Property (Worksheet)

Gets the collection of columns in the worksheet.
Syntax
public WorksheetColumnCollection Columns {get;}

Property Value

The collection of columns in the worksheet.
Remarks

The collection of columns is a fixed length collection, with the maximum number of columns in the collection being Workbook.MaxExcelColumnCount or Workbook.MaxExcel2007ColumnCount, depending on the Workbook.CurrentFormat. Internally, the columns are only created and added to the collection when they are requested.

Note: Iterating the collection will not create all columns. It will only iterate the columns which have already been used. To create and iterate all columns in the worksheet use a For loop, iterating from 0 to one less than the maximum column count, and pass in each index to the collection's indexer.

Requirements

Target Platforms: Android 4.4+, iOS 8+

Development Environments: Visual Studio 2015+, Visual Studio for Mac Preview, Xamarin for Visual Studio 4.2+

See Also