Jim
In your test code try using
Code:
--------------------
oDue = Application.WorksheetFunction.CountIf(Range(StartC ell, Endcell), "<" & Format(Dt, "0")) 'counts the number of dates earlier than today
--------------------
If that works, then expand for your full requirement.
HTH
rylo
--
rylo
------------------------------------------------------------------------
rylo's Profile:
http://www.thecodecage.com/forumz/member.php?userid=28
View this thread:
http://www.thecodecage.com/forumz/sh...ad.php?t=29459