Question: Hi, I am doing a macro VBA that sends emails when the due date is 7 days away. The macro paste above is working perfectly
Hi,
I am doing a macro VBA that sends emails when the due date is 7 days away. The macro paste above is working perfectly fine; the only problem is sending the email to the last user that meets the criteria. Let's say that three users meet the criteria; therefore, they would have to receive three different emails. Instead, just the user located in the last row gets the email. Do you know how to modify the code so all users receive the email when the criteria is met?

Here is the code;
Private Sub Workbook_Open() Dim i As Long Dim OutApp, OutMail As Object Dim strto, strcc, strbcc, strsub, strbody As String Set OutApp = CreateObject("Outlook.Application") OutApp.Session.Logon Set OutMail = OutApp.CreateItem(0) For i = 2 To Range("C65536").End(xlUp).Row If Cells(i, 6) "Y" Then If Cells(i, 3) - 7
Name Amit Jack Reminder Sent Y Project ABC CDE FGH Due Date Email 14/07/2021 amit@amit.com 15/03/2021 jack@jack.com 16/03/2021 jill@jill.com Reminder 1 Mail Sent 11/03/2021 12:35:52 Mail Sent 11/03/2021 12:35:52 Mail Sent 11/03/2021 12:35:52 Y Jill Y Name Amit Jack Reminder Sent Y Project ABC CDE FGH Due Date Email 14/07/2021 amit@amit.com 15/03/2021 jack@jack.com 16/03/2021 jill@jill.com Reminder 1 Mail Sent 11/03/2021 12:35:52 Mail Sent 11/03/2021 12:35:52 Mail Sent 11/03/2021 12:35:52 Y Jill Y
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
