VBA Send Reminder Emails Based on Cell Dates

ScottWUK

New Member
Joined
Jan 26, 2018
Messages
10
Hey Everyone,
I wonder if you can help me with some VBA for sending out reminder emails based on cell contents. I have a worksheet that looks like this:

RoleNameManager NameManager EmailStatusOpp DateRecruitment Deadline1st Reminder Email Sent2nd Reminder Email Sent
OfficerBillSarahsarah@sarah.comClosed01/02/201820/01/2018
AssistantBobDarrendarren@darren.comOpen04/05/201806/04/2018

<tbody>
</tbody>

I want to be able to send an email to the "manager email" if the opportunity date has passed (todays date) and an email hasnt been sent yet. I would then like to send a 2nd reminder email 14 days after the first email was sent. Could anyone help with some VBA for this? I have a set of code already but I just dont have the knowledge/experience to bend this to my will! Below is the code in case it gives you anything to work with

Code:
Sub SendEMail()

    Dim OutlookApp As Outlook.Application
    Dim MItem As Outlook.MailItem
    Dim cell As Range
    Dim Subj As String
    Dim EmailAddr As String
    Dim Recipient As String
    Dim Msg As String
    
    'Create Outlook object
    Set OutlookApp = New Outlook.Application
    
    'Loop through the rows
    For Each cell In Columns("B").Cells.SpecialCells(xlCellTypeVisible)
        If cell.Value Like "?*@?*.?*" And _
        LCase(Cells(cell.row, "C").Value) = "active" Then
            EmailAddr = EmailAddr & ";" & cell.Value
        End If
    Next
    
    Msg = "Dear Task Manager,"
    Subj = ""
    
    'Create Mail Item and view before sending
    Set MItem = OutlookApp.CreateItem(olMailItem)
    With MItem
        .To = ""
        .BCC = EmailAddr
        .Subject = Subj
        .Body = Msg
        .Display
    End With


End Sub

Many thanks in advance!
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

Forum statistics

Threads
1,214,386
Messages
6,119,214
Members
448,874
Latest member
b1step2far

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top