Help Center

ColSelproperty

Returns or sets the start or end column for a range of cells.

Windowspropertydoc-orphan
No implementation located. This member is documented, but the source scan found no matching declaration. It is likely declared in a header this scan does not resolve, or provided by a macro.

Syntax

PROPERTY ColSel () AS LONG
PROPERTY ColSel (BYVAL nCol AS LONG)

Parameters

NameDescription
nColA Long value that specifies the start or end column for a range of cells.

Description

Returns or sets the start or end column for a range of cells.

Remarks

ColSel works in conjunction with the Col property to define a horizontal selection block. The selection spans from the column index specified by Col to the column index specified by ColSel.

Whenever you set the Row and Col properties, RowSel and ColSel are automatically reset, so the cursor becomes the current selection. To select a block of cells from code, you must first set the Row and Col properties, and then set RowSel and ColSel. Note that RowSel may be above or below Row, and ColSel may be to the left or to the right of Col.

Example

' Move the active focus to the start of the range grid.Col = 1

' Extend the selection highlight to the end of the range grid.ColSel = 3

Reference