Column Property

Applies To

Range object.

Description

Returns the number of the first column in the first area in the specified range. Read-only Long.

Remarks

Column A returns 1, column B returns 2, and so on.

To return the number of the last column in the range, use the following expression.

myRange.Columns(myRange.Columns.Count).Column
See Also

Columns property, Row property, Rows property.

Example

This example sets the column width of every other column on Sheet1 to 4 points.

For Each col In Worksheets("Sheet1").Columns
    If col.Column Mod 2 = 0 Then
        col.ColumnWidth = 4
    End If
Next col