i've put a check cell in column F so you do not repeat reminders
Private Sub Workbook_Open()
Dim i As Long
Dim OutApp, OutMail As Object
Dim strto, strcc, strbcc, strsub, strbody As String
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
For i = 2 To Range("C65536").End(xlUp).Row
If Cells(i, 6) <> "Y" Then
If Cells(i, 3) - 7 < Date Then
strto = Cells(i, 4).Value 'email address
strsub = "Project " & Cells(i, 2).Value & " is due on Due date " & Cells(i, 3).Value 'email subject
strbody = "Dear " & Cells(i, 1).Value & vbNewLine & "please update your project status" 'email body
With OutMail
.To = strto
.Subject = strsub
.Body = strbody
'.Send
.display
End With
Cells(i, 5) = "Mail Sent " & Now()
Cells(i, 6) = "Y"
End If
End If
Next
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
Bookmarks