Cells

 

Cells 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(1, 1, 4, 5). Format.BackColor = grfColorRed

 

Used by: Worksheet object, WksRange object