Sending out multiple emails from multiple sheets in a single workbook based on listed dates.

tlpotter

New Member
Joined
Jun 8, 2017
Messages
1
I’ve seen several threads and videos addressing how to use a macro to send an email from excel using outlook. All good there. However, I’ve got a significantly more difficult task to try to accomplish.

I’m trying to get a button added to my first sheet in the workbook that will search each sheet, and if the date is the same as what is listed in a specific column, send a group of specified emails out.

[TABLE="width: 1752"]
<tbody>[TR]
[TD][/TD]
[TD]2R25
[/TD]
[TD]1R28
[/TD]
[TD]2R26
[/TD]
[TD]1R29
[/TD]
[TD]E-Mail
[/TD]
[TD]Milestone
[/TD]
[TD]Opening Subject
[/TD]
[TD]Reminder Subject
[/TD]
[TD]Closing Subject
[/TD]
[/TR]
[TR]
[TD]Open Date
[/TD]
[TD]5/15/2017
[/TD]
[TD]11/1/2017
[/TD]
[TD]11/7/2018
[/TD]
[TD]5/16/2019
[/TD]
[TD][/TD]
[TD]Milestone 53
[/TD]
[TD]is Open!
[/TD]
[TD] Closes in 2 Weeks
[/TD]
[TD] Closure Due Today!
[/TD]
[/TR]
[TR]
[TD]Email Sent?
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Reminder Date
[/TD]
[TD]10/1/2017
[/TD]
[TD]3/18/2018
[/TD]
[TD]3/22/2019
[/TD]
[TD]9/28/2019
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Email Sent?
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Message To Send:
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Close Date
[/TD]
[TD]10/15/2017
[/TD]
[TD]4/1/2018
[/TD]
[TD]4/5/2019
[/TD]
[TD]10/12/2019
[/TD]
[TD][/TD]
[TD][/TD]
[TD]MS.53 – All Pre-Outage Work Completed

Definition
Implement the pre-outage work schedule such that all pre-outage work is completed prior to the outage start.

Milestone Owner - Maintenance Director

Milestone Dates
-5 months to 0 Months

Performance Indicator
Pre-outage work order tasks yet to be worked compared to the work down curve.

Specific Requirements to Satisfy Milestone

• Pre-outage work is completed prior to the start of the outage.

• Pre-outage work status is tracked and report out on the daily plant status call.

NOTE: Pre-outage work that supports critical path outage activities should be completed one week prior to the outage start, (the intent of the one-week requirement is so that the organization could start this critical path work within 24 hours of a unit trip).

Deliverable
None


[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Email Sent?
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


For example, we’ll take Sheet MS-4. If today’s date is equal to the date listed in one of the 4 columns (B-D) it sends out an email to the recipients in column F. The email subject line is made up of elements from cells G2 through J2 depending on which date was flagged from columns B-E, and the email body will be from Cell H6. Also, once the email is sent, it would flag that the email was sent by placing a Y in the cell below the indicated date, and would not send a second email out for that specific sheet if it has already been sent (i.e. 2 different users open the workbook and run the macro, you don’t send out the same email twice.) So, if today was 4/15/2016, the email would go to all recipients in Column F, and would look like this:

Subject:
2R25 Milestone 4 is Open!

Body:
MS.53 – All Pre-Outage Work Completed

Definition
Implement the pre-outage work schedule such that all pre-outage work is completed prior to the outage start.

Milestone Owner - Maintenance Director

Milestone Dates
-5 months to 0 Months

Performance Indicator
Pre-outage work order tasks yet to be worked compared to the work down curve.

Specific Requirements to Satisfy Milestone

• Pre-outage work is completed prior to the start of the outage.

• Pre-outage work status is tracked and report out on the daily plant status call.

NOTE: Pre-outage work that supports critical path outage activities should be completed one week prior to the outage start, (the intent of the one-week requirement is so that the organization could start this critical path work within 24 hours of a unit trip).

Deliverable
None



I know this is a lot, but I would really appreciate the help. Haven’t done much coding before I started looking at this.
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Forum statistics

Threads
1,223,236
Messages
6,170,917
Members
452,366
Latest member
TePunaBloke

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