View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default value of any cell in row 1 = 8 then colour the whole row

Just so you don't stunt your learning growth, using evaluate would be the
slow way to call countif. It can be called directly from VBA

If Application.WorksheetFunction.COUNTIF(rows(1),8) 0 Then
'Yellow
Cells(1).EntireRow.Interior.ColorIndex = 6
Else
'None
Cells(1).EntireRow.Interior.ColorIndex = -4142
End If

--
Regards,
Tom Ogilvy


"JJ" wrote in message
...
Thanks William, that works beautifully.


"William Benson" wrote in message
...
Hi JJ,

If Evaluate("=COUNTIF(A1:IV1,8)") 0 Then
'Yellow
Cells(1).EntireRow.Interior.ColorIndex = 6
Else
'None
Cells(1).EntireRow.Interior.ColorIndex = -4142
End If


"JJ" wrote in message
...
How would I do this please?

If the value of any cell in row 1 = 8 then colour the whole row light
yellow.