Results 1 to 3 of 3

VBA to send email using data from the EXCEL including email address, subject and body text

Threaded View

  1. #1
    Registered User
    Join Date
    08-09-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2007/2010/365
    Posts
    82

    VBA to send email using data from the EXCEL including email address, subject and body text

    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.
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by ec4excel; 08-18-2016 at 11:06 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to send email from excel using VBA with Cell Range (Including Images) as Email Body
    By Novice_To_Excel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-24-2014, 05:06 AM
  2. vba pull data from outlook body of email through email or subject of mail into excel
    By breadwinner in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-01-2014, 04:37 AM
  3. [SOLVED] Excel can send mail with multiple cells info as email body and subject, befr 3 day of due
    By ExcelUser2707 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-19-2013, 06:49 AM
  4. [SOLVED] Excel can send mail with multiple cells info as email body and subject, befr 3 day of due
    By ExcelUser2707 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-13-2013, 04:29 AM
  5. export outlook 2007 email into excel with subject and body of email
    By akulka58 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-25-2013, 02:37 PM
  6. Send email integrating cell data into Subject and Body, with attached invoice
    By KarBar110 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-08-2012, 05:36 PM
  7. [SOLVED] Send Email With Prompt for Subject & Body
    By nrichardson in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-25-2012, 04:11 PM
  8. Replies: 6
    Last Post: 12-02-2011, 02:14 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1