I got this vba from some youtube videos but the email column was not able to read and become the mailto function.
Purpose of this worksheet:
To send email to customer when column N is going to expire. Email to be send on every 15th of the month for the next month expiring. Example, on 15th Aug will send email to customers whose VPC expiring in Sep and 15 Sep to send email to those expiring in Oct.
I had made a column H to show what data I will need to be place in the email. Ideally, I need not create this column H if this can be done by vba but I think just to make this column is for an easier vba to work.
I will need to customized the subject so that I know which customers I had sent.
Can someone teach me how to point the vba to extract the data and how to join the fixed header with different data.
Sub SendRem()
Dim OutLookApp As Object
Dim OutLookMailItem As Object
Dim iCounter As Integer
Dim MailDest As String
Set OutLookApp = CreateObject("OutLook.application")
Set OutLookMailItem = OutLookApp.CreateItem(0)
With OutLookMailItem
MailDest = ""
For iCounter = 1 To WorksheetFunction.CountA(Columns(13))
If MailDest = "" And Cells(iCounter, 17).Offset(0, -1) = "Send Rem" Then
MailDest = Cells(iCounter, 13).Value
ElseIf MailDest <> "" And Cells(iCounter, 17).Offset(0, -1) = "Send Rem" Then
End If
Next iCounter
.Subject = "Notice of Renewal"
.Body = "This is to inform you that the following is due for renewal"
.Display
End With
Set OutLookMailItem = Nothing
Set OutLookApp = Nothing
End Sub
Attachment 475920
Don't know why the attaching of the excel file is not working. The email is on column G, due date is on column N, Name of the person is on column F, vehicle is on column J. After I submit the thread and see if I can attach.
Bookmarks