Columns Method [Worksheet]

The Columns method returns a range object containing one or more entire columns of cells. Returns a WksRange object.

Syntax

object.Columns( Col1, Col2 )

 

Parameter Type Description
Col1 Variant required, see remarks. The range may have a single column.
Col2 Variant optional, see remarks

 

Remarks

See Specifying Cell Coordinates for more information on selecting cells.

Example

This example demonstrates how to change the cell color to green in columns A through C.

Wks.Columns(1, 3).Format.BackColor = grfColorGreen

 

Used by: Worksheet object