When I transfer the code to the real spreadsheet I'm working with I get a Type Mismatch error. Please take a look at the code:
Sub EmailReminder()
FinalRow = Cells(Rows.Count, 2).End(xlUp).Row
For i = 2 To FinalRow
For j = 15 To 17
If Cells(i, j).Value = Date Then
strBodyMonths = "six"
If j = 16 Then strBodyMonths = "four"
If j = 17 Then strBodyMonths = "three"
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = "[email protected]"
.Subject = "Contract Expiration Notice for " & Cells(i, 2)
.Body = "Hello Ron, the contract for " & Cells(i, 2) & _
" will expire in " & strBodyMonths & " months from today, " & Date & " on " & Cells(i, 14) & ". Have a wonderful day!"
.Send
End With
End If
Set OutMail = Nothing
Next
Next
End Sub
Thank you again!
Bookmarks