April 2006
Beginner
1114 pages
98h 16m
English
worksheet.Cells
Returns a Range object that represents cells on the worksheet. The syntax shows the Cells property without arguments, which returns all the cells in a worksheet as a Range object. However, you can also enter the specific range you want to return as if you were using the syntax for a Range object.
The following code sets the font size to 12 for every cell in the WombatBattingAverages worksheet so the athletes can easily read them:
Worksheets("WombatBattingAverages").Cells.Font.Size = 12The following code highlights batting averages .300 and over:
Dim rwIndex As Integer
For rwIndex = 1 To 3
With Worksheets("WombatBattingAverages").Cells(rwIndex, 2)
If .Value >= 0.3 Then
.Font.Color = RGB(255, 0, 0)
End If
End With
Next rwIndexRead now
Unlock full access