Results 1 to 2 of 2

Thread: select email address from cell and add to cc email

  1. #1
    Member
    Join Date
    May 2013
    Posts
    84
    Rep Power
    11

    select email address from cell and add to cc email

    Hi

    Dont know if this can be done or not.

    i am wanting the auto email code to pick up all the email address in the selected list and add them into the cc email.

    if tou look at the ppe sheet there are three rows(there will be a lot more) but only two would be selected to go into the table in the email because
    the first one is not due yet, so is there a way to select only the due/overdue emails from column e and add them to the cc so that only the people in the table gets a reminder email???
    this would need to happen for all sheets and any additional ones added.all would be the same format.

    thank you for any help in advance
    Attached Files Attached Files

  2. #2
    Administrator Admin's Avatar
    Join Date
    Mar 2011
    Posts
    1,122
    Rep Power
    10
    Hi

    See the code where I commented one line.

    Code:
    If ddiff > 1 Then
        c.Offset(0, 1).Value = ddiff & " days from now"
        
        '************* commented the following line. it is not either due or overdue************************************
        'body = body & c.Offset(0, -4) & ": " & Chr(9) & c.Offset(0, -3) & Chr(9) & Chr(9) & Chr(9) & ddiff & " Days from now" & vbCrLf
        
    Else
        If ddiff = 0 Then
            c.Offset(0, 1).Value = "due today"
            body = body & c.Offset(0, -4) & ": " & Chr(9) & c.Offset(0, -5) & ": " & Chr(9) & Chr(9) & c.Offset(0, -3) & ": " & Chr(9) & c.Offset(0, -1) & ": " & Chr(9) & " Due today" & ": " & vbCrLf
        Else
            c.Offset(0, 1).Value = ddiff * -1 & " days overdue"
            body = body & c.Offset(0, -4) & ": " & Chr(9) & c.Offset(0, -5) & ": " & Chr(9) & c.Offset(0, -3) & ": " & Chr(9) & c.Offset(0, -1) & ": " & Chr(9) & ddiff * -1 & " Days overdue" & ": " & vbCrLf
            '///New Code
            Set rngbody = Union(rngbody, c.Offset(0, -5).Resize(1, 7))
        End If
    End If
    Cheers !

    Excel Range to BBCode Table
    Use Social Networking Tools If You Like the Answers !

    Message to Cross Posters

    @ Home - Office 2010/2013/2016 on Win 10 (64 bit); @ Work - Office 2016 on Win 10 (64 bit)

Similar Threads

  1. VBA To Extract Email Address From Text
    By dunndealpr in forum Excel Help
    Replies: 43
    Last Post: 06-05-2019, 03:56 PM
  2. Converting text to an email address hyperlink
    By Aerodynamix in forum Excel Help
    Replies: 2
    Last Post: 08-09-2013, 09:56 PM
  3. VBA Code to email using Globals Address Book
    By cdurfey in forum Excel Help
    Replies: 5
    Last Post: 05-28-2013, 10:25 PM
  4. Replies: 2
    Last Post: 05-23-2013, 08:08 AM
  5. Replies: 1
    Last Post: 08-21-2012, 07:36 PM

Posting Permissions

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