A
allan.roebig
Can someone please help!!
I'm trying to send an automatic email when 2 conditions are met.
In column X I have yes/no drop down box. If Column X has a "no" and the
date is 14 days older than dates that are in column B I want an email
automatically sent to the corresponding email address in Column G.There
are about 8 different email address.
I have the Send Mail code (below) from Ron deBruins site but I just
can't seem to get the worksheet code right.
Sub Mail()
Dim OutApp As Object
Dim OutMail As Object
Dim strto As String, strcc As String, strbcc As String
Dim strsub As String, strbody As String
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
strto = "(e-mail address removed)"
strcc = ""
strbcc = ""
strsub = "Important message"
strbody = "Hi there" & vbNewLine & vbNewLine & _
"Cell A1 is changed"
With OutMail
.To = strto
.CC = strcc
.BCC = strbcc
.Subject = strsub
.Body = strbody
.Send
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
I'm trying to send an automatic email when 2 conditions are met.
In column X I have yes/no drop down box. If Column X has a "no" and the
date is 14 days older than dates that are in column B I want an email
automatically sent to the corresponding email address in Column G.There
are about 8 different email address.
I have the Send Mail code (below) from Ron deBruins site but I just
can't seem to get the worksheet code right.
Sub Mail()
Dim OutApp As Object
Dim OutMail As Object
Dim strto As String, strcc As String, strbcc As String
Dim strsub As String, strbody As String
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
strto = "(e-mail address removed)"
strcc = ""
strbcc = ""
strsub = "Important message"
strbody = "Hi there" & vbNewLine & vbNewLine & _
"Cell A1 is changed"
With OutMail
.To = strto
.CC = strcc
.BCC = strbcc
.Subject = strsub
.Body = strbody
.Send
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub