Col

This property returns and sets the coordinates of the active cell in a Grid control.

Syntax

grid.Col [= number]

Parameters

grid
Object expression that evaluates to an Grid control.
number
Long. Numeric expression that specifies the position of the active cell.

Remarks

The Col property is unavailable at design time.

Use this property to specify a cell in a Grid control or to determine which row or column contains the current cell. Columns and rows are numbered from 0, beginning at the top for rows and at the left for columns.

Setting these properties automatically resets ColSel properties, so the selection becomes the current cell. Therefore, to specify a block selection you must set the Col property first, then set ColSel.

The value of the current cell, defined by the Col setting, is the text contained in that cell. To modify a cell's value without changing the selected Col property, use the TextMatrix property.

When a Grid is empty, Col is 0.