Hi,
One way. I'm assuming there are several different dates in your column and you want the email sent if the latest date in the list is more than 21 days ago.
So introduce a cell named "CheckDate" and in this cell enter the formula:
=MAX(A:A)
assuming column A is the one containing the dates.
Then create a module level macro as follows
Sub CheckDate21()
Dim OutApp As Object
Dim OutMail As Object
If Date - Range("CheckDate") > 21 Then
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = "youremail@yourisp.blah"
.Subject = "Three weeks have passed!"
.Body = "See Subject"
'.display
.Send
End With
Set OutMail = Nothing
Set OutApp = Nothing
End If
End Sub
Then decide what event you want to use to trigger the macro. If you want this to run the in the Workbook open event add a line of code
Call CheckDate21
If you want to run this at any time then create a button and attach the macro to the button.
Bookmarks