+ Reply to Thread
Results 1 to 3 of 3

Generating an automatical email to outlook from excel based on date

  1. #1
    Registered User
    Join Date
    12-21-2006
    Posts
    35

    Smile Generating an automatical email to outlook from excel based on date

    Hi Guys,

    I have a spreadheet with a list of actions on it each with a spcific deadline, and each with a specifc owner. What i am trying to do is to create some VBA code which will automatically look up the due date of the action and if it is upcoming (say within 15 days of the date) then an email is generated to the individual (who's email address will be held on the same row of data).

    Is this possible ,if not would it be possible to have all emails sent to my email address.

    so for example i have in cell A1 the current date

    row I has the name of the report which i want to put in the subject section of the email.

    row p has the content that i want to include in the email

    row c has the email address of the person responsible for the action.

    can anyone help?

    Thanks in advance

  2. #2
    Registered User
    Join Date
    12-21-2006
    Posts
    35
    anyone???

  3. #3
    Registered User
    Join Date
    12-21-2006
    Posts
    35
    I have some code which i believe is a start can anyone help.....???

    Sub Sendmail()

    Set OutApp = CreateObject("Outlook.Application")
    Set OutMail = OutApp.CreateItem(0)
    sTo = "[email protected]"
    sCC = ""
    sBCC = ""
    sSubject = ""
    strbody = "Hello" & vbNewLine & vbNewLine & _
    "There is an outstanding audit action which requires your attention."
    With OutMail
    .To = sTo
    .CC = sCC
    .BCC = sBCC
    .Subject = sSubject
    .Body = strbody
    .Send
    End With
    Set OutMail = Nothing
    Set OutApp = Nothing
    End Sub

    Sub CheckDue()
    Dim rDates As Range, cl As Range

    Set rDates = Sheet1.Range("a1", Range("a65536").End(xlUp))

    For Each cl In rDates
    If cl.Value <= A1 Then
    sTo = cl.Offset(0, 1).Value 'assumes addresses in Column B
    Call Sendmail
    End If

    Next cl

    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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