V
vbnewbie
I use Excel 2002 and I am trying to use an expression to calculate any
entries older than 14 days and then send an email as a reminder. Date is in
column1. I have the following code
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
Dim OutApp As Object
Dim OutMail As Object
Dim cell As Range
Application.ScreenUpdating = False
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
On Error GoTo cleanup
Set OutMail = OutApp.CreateItem(0)
etc...
The only bit thats not working is the And Cells(j, 1).Value > (Now - 14) -
it sends email to all regardless of the date.
Please help!
Thanks
entries older than 14 days and then send an email as a reminder. Date is in
column1. I have the following code
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
Dim OutApp As Object
Dim OutMail As Object
Dim cell As Range
Application.ScreenUpdating = False
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
On Error GoTo cleanup
Set OutMail = OutApp.CreateItem(0)
etc...
The only bit thats not working is the And Cells(j, 1).Value > (Now - 14) -
it sends email to all regardless of the date.
Please help!
Thanks