Results 1 to 4 of 4

Send Email Based on Cell Values

Threaded View

  1. #1
    Registered User
    Join Date
    02-22-2016
    Location
    oregon
    MS-Off Ver
    excel 2013
    Posts
    15

    Send Email Based on Cell Values

    I'm trying to using an If Statement with VBA but have never done it before.
    IF C3="A" in the active excel workbook, send email to "Person A" & cc "Distribution List A". If not send email to "Person B" & cc "Distribution B".
    Code shown below. Thanks for your help!!!!!!!



    Dim OutApp As Object
        Dim OutMail As Object
         
        Set OutApp = CreateObject("Outlook.Application")
        OutApp.Session.Logon
        Set OutMail = OutApp.CreateItem(0)
         
        On Error Resume Next
        With OutMail
            .To = "Person A"
            .Cc = "Distribution List A"
            '.BCC = ""
            .Subject = "My Report"
            .Body = "Report has been included as an attachment."
            .Attachments.Add ActiveWorkbook.FullName
            .Display
        End With
        On Error GoTo 0
        
        Set OutMail = Nothing
        Set OutApp = Nothing
    End Sub
    Last edited by weeblegobble; 02-18-2018 at 05:28 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Macro to send an email via Lotus Notes to an employee based upon cell values
    By kodonnell in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-02-2015, 12:43 PM
  2. Workflow with signatures (if cell=x then send email, if signed then send email)
    By Kate2811 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-25-2014, 05:37 AM
  3. Send email to address based on cell value
    By shiftyspina in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-12-2014, 03:06 PM
  4. Send email based on address in a cell
    By behnam in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-19-2013, 02:53 PM
  5. excel send an email based on cell value (Date)
    By Arpanasiaworld in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-26-2013, 07:59 PM
  6. Send email depending on cell values in selected row
    By tandridge in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-01-2011, 10:15 AM
  7. send email message based on cell conditions
    By danusko in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-27-2009, 02:24 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