View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
vbnewbie vbnewbie is offline
external usenet poster
 
Posts: 19
Default Time calculation

I have a datasheet with a number of columns, the first of which is date in
the format xx.xx.xxxx. I want to be able to work out which entries are over
14 days old and and send them an email based on another column. I have tried
the code as follows-
For j = 1 To lastcell
If Cells(j, 13) < "" And Cells(j, 14) = "" And Cells(j, 1).Value (Now()
- 14) And Cells(j, 15) = "" Then
do something
next j
endif
The code to display the email works ok so I have omitted it, however it
sends an email to all even though they are less than 14 days old. Obviously
it is the
And Cells(j, 1).Value (Now() - 14)
which is wrong

Can someone please help, I have been trying to figure this out for 4 hours
now!

Thank you