Columns [WksRange]

Columns returns a range containing all or some of the columns of the current range. Returns a WksRange object.

Syntax

object.Columns( Col1, Col2 )

Parameter

Type

Required/

Optional

Default

Description

Col1

Variant

Required

This Provides the first column of the current range. The range may have a single column.

Col2

Variant

Optional

This Provides the last column of the current range.

Remarks

See Specifying Cell Coordinates for more information on selecting cells.

Example

This example demonstrates how to set the cell color to chalk in columns 2 and 3 of a range.

WksRange.Columns(Col1:=2, Col2:=3).Format.BackColor = srfColorChalk

Used by: WksRange object