try this:
Sub test()
Dim x, i As Long, idate, lrow As Long
Application.ScreenUpdating = 0
lrow = Cells(Rows.Count, "a").End(xlUp).Row
With Range("ad2", Cells(Rows.Count, "ad").End(xlUp))
x = .Value
For i = 1 To UBound(x)
idate = x(i, 1)
If IsDate(idate) Then x(i, 1) = CDate(idate)
Next
.Clear
.Value = x
End With
Range("af2:af" & lrow) = "=if(countif(x2:ab2,"">0""),""no"",if(and(ac2>0,ad2=e2),""no"",""yes""))"
With Range("a2:ae" & lrow)
.Select
.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, Formula1:="=$AF2=""yes"""
.FormatConditions(1).Interior.ColorIndex = 6
End With
Range("a1").Activate
Application.ScreenUpdating = 1
End Sub
Bookmarks