VBA auto reminder email

ashani

Active Member
Joined
Mar 14, 2020
Messages
345
Office Version
  1. 365
Platform
  1. Windows
hi,

I wonder if someone could guide me please.

In my workbook I would like to setup an automatic email reminder in the following sequence :

- Email address is in cell a2
- if cell b2 shows "Outstanding" than reminder goes out to the user every other day.

many thanks
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
hi experts,
any idea on this one please?
thank you
 
Upvote 0
VBA Code:
Option Explicit

Sub Mail_workbook_Outlook()
'& vbNewLine & vbNewLine & _

    Dim OutApp As Object
    Dim OutMail As Object
    Dim sndEmail As String
        
    Set OutApp = CreateObject("Outlook.Application")
    Set OutMail = OutApp.CreateItem(0)
        
        'establish TO email address
        sndEmail = Sheets("Sheet1").Range("A2").Value
                
        'On Error Resume Next
        
        'If these two conditions exist, send email ... otherwise ignore
        If Sheet1.Range("B2").Value = "Outstanding" And Sheet1.Range("C2").Value = Date Then
            
            With OutMail
            
                .To = sndEmail
                .CC = ""
                .BCC = ""
                .Subject = "Outstanding"
                .Body = "Dear colleague," & vbNewLine & vbNewLine & _
                        "We are happy to inform you that ..." & vbNewLine & vbNewLine & _
                        "Sincerely," & vbNewLine & _
                        "John Smith"
                        
                .Display                                'Display email prior to sending
                Sheet1.Range("C2").Value = Date + 2     'Change displayed date to next "every other day"
                
            End With
        
        End If
    
        On Error GoTo 0
    
    
    Set OutMail = Nothing
    Set OutApp = Nothing
End Sub

Download workbook : WORKS - Email Every Other Day.xlsm
 
Upvote 0

Forum statistics

Threads
1,214,921
Messages
6,122,280
Members
449,075
Latest member
staticfluids

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