mikenelena
Board Regular
- Joined
- Mar 5, 2018
- Messages
- 139
- Office Version
- 365
- Platform
- Windows
I have a list of e-mail addresses in column D. Column B populates from a query as mileage reports are received from employees. Until a report is received and captured by the query, the cell shows "#N/A" (A VLookup with no result yet.)
I would like to send a single e-mail reminder to all employees that have not submitted a mileage report.
This is what I am working with so far. The line in red captures ALL the e-mail addresses, and needs to change, but to what? I'm guessing an "If" statement, but can't craft it properly.
Any help would be most appreciated!
Thanks,
...Mike
I would like to send a single e-mail reminder to all employees that have not submitted a mileage report.
This is what I am working with so far. The line in red captures ALL the e-mail addresses, and needs to change, but to what? I'm guessing an "If" statement, but can't craft it properly.
Code:
Public Sub Mail_Workbook_1Click()
Dim OutApp As Object
Dim OutMail As Object
Dim EmailTo As String
Dim BCCTo As String
Dim strbody As String
[COLOR=#ff0000] BCCTo = Join(Application.Transpose(Worksheets("MileageReports").Range("D5:D26").Value), ";")[/COLOR]
strbody = "****** style=font-size:11pt;font-family:Calibri>Your mileage report is overdue." </BODY>"
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
On Error Resume Next
With OutMail
.Display
.BCC = BCCTo
.Subject = "Mileage Reports Due"
.HTMLBody = strbody & "<br>" & .HTMLBody
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
Any help would be most appreciated!
Thanks,
...Mike