Hi Guys,
I have an excel sheet with 60 rows and 5 columns and I want to change the color of individual cells based on cell values.
I'm posting a code below for this which seems to be working but still has some flaws in it. Please help me rectifying this code.
Sub changecolor()
Dim i, j As Integer
For i = 1 To 60
For j = 1 To 5
If Cells(i, j) < 8 Then
Cells(i, j).Interior.ColorIndex = 6
Else: Cells(i, 1).Interior.ColorIndex = 8
End If
Next j
Next i
End Sub
Or suggest me a better way to do this.
Thanks,
Prasanna
Bookmarks