Log in

View Full Version : select email address from cell and add to cc email



peter renton
01-29-2014, 02:31 PM
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

Admin
01-29-2014, 09:42 PM
Hi

See the code where I commented one line.


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