View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Keith74 Keith74 is offline
external usenet poster
 
Posts: 120
Default time frame restriction

Hi Jzamil

Dates are one big problem in excel, you need to be certain which date
format you're working with e.g. is it 01/02/2008 or 02/01/2008, so
step through your code and make sure. I'd replace your IF with

If cdate(Sheet2.Cells(a, 2)) = cdate(Sheet12.Cells(6, 3)) And
cdate(Sheet2.Cells(a, 2)) <= cdate(Sheet12.Cells(6, 4)) Then

to confirm that excel is treating the values as dates, though you may
be better off using .NumberFormat.

hope this gets you started.

Keith