>I think that this sort of works but because the seconds derived from a >dateTime are large negative numbers, I'm worried that it wont work for all >values of startHour%, endHour%. Note if startHour% = endHour% then every >nowHour% is 'legal'. > Michael, I think your code is fine, but you can address your concern by eliminating the negative numbers. Change >dim nowSecs&, startSecs&, endSecs&, NowTimeIsLegal% to: dim nowSecs&`, startSecs&`, endSecs&`, NowTimeIsLegal% That should be all you need. Let me know if I've misunderstood. e-e =J= a y "