This documentation is archived and is not being maintained.

Worksheet.Cells Property

Office 2007
Returns a Range object that represents all the cells on the worksheet (not just the cells that are currently in use.



expression   A variable that represents a Worksheet object.


Because the Item property is the default property for the Range object, you can specify the row and column index immediately after the Cells keyword. For more information, see the Item property and the examples for this topic.

Using this property without an object qualifier returns a Range object that represents all the cells on the active worksheet.


This example sets the font size for cell C5 on Sheet1 to 14 points.

Visual Basic for Applications
Worksheets("Sheet1").Cells(5, 3).Font.Size = 14

This example clears the formula in cell one on Sheet1.

Visual Basic for Applications

This example sets the font and font size for every cell on Sheet1 to 8-point Arial

Visual Basic for Applications
With Worksheets("Sheet1").Cells.Font
    .Name = "Arial"
    .Size = 8
End With