Send an e-mail based on the number of days until due

Even

Board Regular
Joined
Jan 1, 2013
Messages
81
Office Version
  1. 365
Platform
  1. Windows
Hi there, is it a way to generate an e-mail that includes the text I show beneath? When it is less den 90 days until renewal, I want to send out an e-mail to the person in charge of the customer about the renewal terms.

Send an automatic e-mail based on due date.xlsx
ABCDEFGHIJKLMNOPQR
15/17/2021
2General terms%Special termsCustomerDue dateTime until dueTransportD&OCyberCrimeArtName in chargeE-mail
3Transport4,50%5,00%Example 19/1/211074,50%3,50%5,00%
4D&O3,50%5,00%Example 211/30/211975,00%3,50%
5Cyber3,50%5,00%Example 37/1/21454,50%5,00%JohnJohn@test.com
6Crime3,50%5,00%Example 48/25/211005,00%5,00%
7Art3,50%5,00%Example 56/1/21154,50%3,50%5,00%JaneJane@test.com
8Example 67/30/21745,00%3,50%Jasonjason@test.com
9Example 77/1/21454,50%5,00%LydiaLydia@test.com
10Example 88/1/21765,00%5,00%EllenEllen@test.com
11Example 98/1/21763,50%
12Example 108/1/21763,50%
13
14
15Email SubjectRenewal
16Email BodyDear… it is soon time for renewal for X customer. The following standard terms of renewal is: Transport : 4,5% D&O: 3,5% Crime: 5% Please let me know if they will be renewing under these terms. Thank you! Sincerely X
17
All products
Cell Formulas
RangeFormula
A1A1=TODAY()
I3,I9,I7,I5I3=$B$3
L3,L10,L6:L7L3=$C$6
J3,J7J3=$B$4
J4,J10,J6,J8J4=$C$4
M4,M8M4=$B$7
K5,K9K5=$C$5
H3:H12H3=G3-$A$1
J11J11=B4
J12J12=B4
Cells with Data Validation
CellAllowCriteria
E3:E12List=$A$9:$A$11
 
I'm glad I could help. I learned mostly through self teaching for over 30 years. A lot of books, internet learning, and a couple classes in school.
 
Upvote 0

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
I found out a way to make the text bold and make the list into a bullet point. However, the text in the end of the e-mail (after the bullet points) is on the same space as the bullet point list. I want it to be alligned to the left. Do you know how I can do that?
Here is the code (made it shorter so it is easier to view):

VBA Code:
If Cells(rCell.Row, colTransport).Text <> "" Then
    body = body & "<ul><li> <b> Transport: </b>" & Cells(rCell.Row, colTransport).Text & "<br>"
End If
If Cells(rCell.Row, colDandO).Text <> "" Then
    body = body & "<ul><li> <b>D&O: </b>" & Cells(rCell.Row, colDandO).Text & "<br>"
End If
body = body & "<br>Please let me know if they will be renewing under these terms.<br><br>Thank you!<br><br>Sincerely X"
 
Last edited:
Upvote 0
You have to both open and close the list <ul> tag and the bullet <il> tags. See how this works. You might want to play around with a few extra <br>'s if you need more paragraphs.

VBA Code:
            body = body & ". The following standard terms of renewal are:<br><ul>"
            If Cells(rCell.Row, colTransport).Text <> "" Then
                body = body & "<li><b>Transport:</b> " & Cells(rCell.Row, colTransport).Text & "</li>"
            End If
            If Cells(rCell.Row, colDandO).Text <> "" Then
                body = body & "<li><b>D&O:</b> " & Cells(rCell.Row, colDandO).Text & "</li>"
            End If
            If Cells(rCell.Row, colCyber).Text <> "" Then
                body = body & "<li><b>Cyber:</b> " & Cells(rCell.Row, colCyber).Text & "</li>"
            End If
            If Cells(rCell.Row, colCrime).Text <> "" Then
                body = body & "<li><b>Crime: " & Cells(rCell.Row, colCrime).Text & "</li>"
            End If
            If Cells(rCell.Row, colArt).Text <> "" Then
                body = body & "<li><b>Art:</b> " & Cells(rCell.Row, colArt).Text & "</li>"
            End If
            body = body & "</ul><br>Please let me know if they will be renewing under these terms.<br><br>Thank you!<br><br>Sincerely X"
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,637
Latest member
Ezio2866

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