Cells

 

The Cells method returns a range object containing one or more worksheet cells. Returns a WksRange object.

 

Syntax

object.Cells( Row, Col, LastRow, LastCol )

 

Parameter

Type

Description

Row

Variant

required, row number in quotes

Col

Variant

optional, column letter in quotes

LastRow

Variant

optional, row number in quotes

LastCol

Variant

optional, column letter in quotes

 

Remarks

See Specifying Cell Coordinates for more information on selecting cells.

 

Example

This example demonstrates how a set the background color of cells A1:E4 to red.

 

Wks. Cells (Row:=1, Col:=1, LastRow:=4, LastCol:=5). Format.BackColor = mvColorRed

 

Used by: WksDocument object, WksRange object