Private Sub CommandButton1_Click()
Dim i, j, jj As Integer
'Clears the existing color format
Range("B7:H29").Select
Selection.Interior.ColorIndex = xlNone
'Formats as reqd.
For i = 7 To 29
If Application.WorksheetFunction.CountBlank(Range("B" & i & ":H" & i)) = 7 Then
Else
For j = 2 To 3
If Cells(i, j) = "" Then
Cells(i, j).Select
Selection.Interior.ColorIndex = 6
End If
Next
For jj = 4 To 8
If IsDate(Cells(i, jj)) And InStr(Cells(i, jj), " ") = 0 Then
Else
Cells(i, jj).Select
Selection.Interior.ColorIndex = 6
End If
Next
End If
Next
End Sub
|