Columns [WksRange]

 

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

 

Syntax

object.Columns( Col1, Col2 )

 

Parameter

Type

Description

Col1

Variant

required; first column, column A equals 1

Col2

Variant

optional; last column

 

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 = mvColorChalk

 

Used by: WksRange object