can we send reminder through outlook if excel spread sheet data and due date

VKMouli

New Member
Joined
Jul 28, 2022
Messages
14
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
  3. Web
Dear Team,
Can anyone suggest how to send reminder through email if excel data and due date and email ids in excel sheet using VBA code.

Best Regards, V K Mouli
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
This will get you 90% of the way there.

VBA Code:
Sub mainSub()
  Dim lngRowNo As Long
  Dim strDueDate As String

  For lngRowNo = 2 to Cells(Rows.Count, 1).End(xlUp).Row
    strDueDate = ThisWorkbook.Sheets("Sheet1").Range("A" & lngRowNo).Value2  'Assume due date is column B
    If strDueDate = Date() Then
      sendEmai(ThisWorkbook.Sheets("Sheet1").Range("C" & lngRowNo).Value2 'Assume email address on column C
    End If
  Next lngRowNo

End Sub

Sub sendEmail(strMailAddress As String)
    Dim appOutlook As Object
    Dim mEmail As Object

    Set appOutlook = CreateObject("Outlook.Application")
    Set mEmail = appOutlook.CreateItem(olMailItem)

    With mEmail
         .To = strMailAddress
         .CC = ""
         .BCC = ""
         .Subject = "This is the subject"
         .HTMLBody = "This is the body of the email"
         '.Attachments.Add
         '.Display
         .Send
    End With
    Set mEmail = Nothing
    Set appOutlook = Nothing
End Sub
 
Upvote 0
Solution

Forum statistics

Threads
1,214,391
Messages
6,119,244
Members
448,879
Latest member
VanGirl

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