VBA auto reminder email

ashani

Active Member
Joined
Mar 14, 2020
Messages
346
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

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
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,215,432
Messages
6,124,858
Members
449,194
Latest member
HellScout

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