snb's post reminded me that I used more code than was needed in the above macro as this shorter code would work the same (although it does
not report "All OK" if all the dates are less than A4's date; rather, it does nothing which matches what PcMax's code does in that circumstance)...
Code:
Sub DateTooLate()
MsgBox Evaluate("MIN(IF(B7:B2500>=A4,ROW(B7:B2500),""""))")
End Sub
And while I hate the square bracket notation snb used in his post, the above would be shortened even more by using it (assuming you do not mind that notation)...
Code:
Sub DateTooLate()
MsgBox [MIN(IF(B7:B2500>=A4,ROW(B7:B2500),""))]
End Sub
Bookmarks