Hi Phil,
If you use the Cells(row,col) instead of Ranges, then stick it in a loop, you will get the effect you require:
Sub CellColours()
Dim i As Integer
Dim j As Integer
For i = 1 To 32
For j = 1 To 5
Cells(j, i).Select
If Selection.Value = 1 Then
Selection.Font.ColorIndex = 3
Selection.Interior.ColorIndex = 3
ElseIf Selection.Value = 2 Then
Selection.Font.ColorIndex = 6
Selection.Interior.ColorIndex = 6
ElseIf Selection.Value = 3 Then
Selection.Font.ColorIndex = 4
Selection.Interior.ColorIndex = 4
Else
Selection.Font.ColorIndex = 39
Selection.Interior.ColorIndex = 39
End If
Next j
Next i
End Sub
Hope this helps!
Enter your message below
Sign in or Join us (it's free).