ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Send Email If (https://www.excelbanter.com/excel-programming/431932-send-email-if.html)

Gee

Send Email If
 
I have a spreadsheet that feeds from an Access Database.

Only certain records are shown, it refreshes every minute and the column
"TIMER" shows the minute difference between the time the call came in and
NOW().

What I'm trying to do is send and email when a record reaches 15
minutes...like if it's been on the spreadsheet for 15 minutes, an email goes
to a particular address.
I need an "IF" statement to do this.
There are usually 1 to 5 records on the spreadsheet.

I need something like:

If any cell in TIMER column = 15 then send the Range of that record (like
A4:K4) to with "NOC TIMER" in the subject line.

Help?

Thank you in advance for any help you can give me.
Gee.



ryguy7272

Send Email If
 
Do you already have the code for sending those emails?
If not, check here.
http://www.rondebruin.nl/sendmail.htm

Also, look here for ideas on how to automate the process of sending those
emails:
http://www.cpearson.com/excel/OnTime.aspx

HTH,
Ryan---

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Gee" wrote:

I have a spreadsheet that feeds from an Access Database.

Only certain records are shown, it refreshes every minute and the column
"TIMER" shows the minute difference between the time the call came in and
NOW().

What I'm trying to do is send and email when a record reaches 15
minutes...like if it's been on the spreadsheet for 15 minutes, an email goes
to a particular address.
I need an "IF" statement to do this.
There are usually 1 to 5 records on the spreadsheet.

I need something like:

If any cell in TIMER column = 15 then send the Range of that record (like
A4:K4) to with "NOC TIMER" in the subject line.

Help?

Thank you in advance for any help you can give me.
Gee.



Gee

Send Email If
 
I looked at those already because I saw them referenced in other "send email
from excel" questions on this forum, I just can't figure out how to the the
"IF" part in there!
Losing my mind in Idaho,
Gee

"ryguy7272" wrote:

Do you already have the code for sending those emails?
If not, check here.
http://www.rondebruin.nl/sendmail.htm

Also, look here for ideas on how to automate the process of sending those
emails:
http://www.cpearson.com/excel/OnTime.aspx

HTH,
Ryan---

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Gee" wrote:

I have a spreadsheet that feeds from an Access Database.

Only certain records are shown, it refreshes every minute and the column
"TIMER" shows the minute difference between the time the call came in and
NOW().

What I'm trying to do is send and email when a record reaches 15
minutes...like if it's been on the spreadsheet for 15 minutes, an email goes
to a particular address.
I need an "IF" statement to do this.
There are usually 1 to 5 records on the spreadsheet.

I need something like:

If any cell in TIMER column = 15 then send the Range of that record (like
A4:K4) to with "NOC TIMER" in the subject line.

Help?

Thank you in advance for any help you can give me.
Gee.



ryguy7272

Send Email If
 
How 'automatic' do you want it to be? Do you want it firing if a user
clicks a button? If so, see below:

Sub modEmail()

If Worksheets("Sheet1").Range("B1") = "Yes" Then

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")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)

strto = "My E-mail Address"
strcc = ""
strbcc = ""
strsub = "CSU Inventory Gain"
strbody = "This is an automated message."

With OutMail
..To = strto
..CC = strcc
..BCC = strbcc
..Subject = strsub
..Body = strbody
..Send
End With

End If


Set OutMail = Nothing
Set OutApp = Nothing

Close Workbook

End Sub

If you want it firing if a value is simple entered into a cell, right-click
the sheet and paste the code into the window that opens:

Private Sub Worksheet_Change(ByVal Target As Range)
'etc., etc.
End Sub

HTH,
Ryan---
--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Gee" wrote:

I looked at those already because I saw them referenced in other "send email
from excel" questions on this forum, I just can't figure out how to the the
"IF" part in there!
Losing my mind in Idaho,
Gee

"ryguy7272" wrote:

Do you already have the code for sending those emails?
If not, check here.
http://www.rondebruin.nl/sendmail.htm

Also, look here for ideas on how to automate the process of sending those
emails:
http://www.cpearson.com/excel/OnTime.aspx

HTH,
Ryan---

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Gee" wrote:

I have a spreadsheet that feeds from an Access Database.

Only certain records are shown, it refreshes every minute and the column
"TIMER" shows the minute difference between the time the call came in and
NOW().

What I'm trying to do is send and email when a record reaches 15
minutes...like if it's been on the spreadsheet for 15 minutes, an email goes
to a particular address.
I need an "IF" statement to do this.
There are usually 1 to 5 records on the spreadsheet.

I need something like:

If any cell in TIMER column = 15 then send the Range of that record (like
A4:K4) to with "NOC TIMER" in the subject line.

Help?

Thank you in advance for any help you can give me.
Gee.



Gee

Send Email If
 
No button clicking at all, it's got to be totally automatic and
unmonitored...when any cell in Column K (which is the NOC field in Access)
gets to 15, an email fires automatically.
In Access it's:

If NOC = "15" Then
DoCmd.SendObject acSendReport, "NOCR", acFormatSNP, , , ,
"NOC AGING", Me.CallNo, False
End If

I don't know how to do that in Excel. I have to have it come from Excel to
solve certain problems.
Thanks,
Gee


"ryguy7272" wrote:

How 'automatic' do you want it to be? Do you want it firing if a user
clicks a button? If so, see below:

Sub modEmail()

If Worksheets("Sheet1").Range("B1") = "Yes" Then

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")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)

strto = "My E-mail Address"
strcc = ""
strbcc = ""
strsub = "CSU Inventory Gain"
strbody = "This is an automated message."

With OutMail
.To = strto
.CC = strcc
.BCC = strbcc
.Subject = strsub
.Body = strbody
.Send
End With

End If


Set OutMail = Nothing
Set OutApp = Nothing

Close Workbook

End Sub

If you want it firing if a value is simple entered into a cell, right-click
the sheet and paste the code into the window that opens:

Private Sub Worksheet_Change(ByVal Target As Range)
'etc., etc.
End Sub

HTH,
Ryan---
--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Gee" wrote:

I looked at those already because I saw them referenced in other "send email
from excel" questions on this forum, I just can't figure out how to the the
"IF" part in there!
Losing my mind in Idaho,
Gee

"ryguy7272" wrote:

Do you already have the code for sending those emails?
If not, check here.
http://www.rondebruin.nl/sendmail.htm

Also, look here for ideas on how to automate the process of sending those
emails:
http://www.cpearson.com/excel/OnTime.aspx

HTH,
Ryan---

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Gee" wrote:

I have a spreadsheet that feeds from an Access Database.

Only certain records are shown, it refreshes every minute and the column
"TIMER" shows the minute difference between the time the call came in and
NOW().

What I'm trying to do is send and email when a record reaches 15
minutes...like if it's been on the spreadsheet for 15 minutes, an email goes
to a particular address.
I need an "IF" statement to do this.
There are usually 1 to 5 records on the spreadsheet.

I need something like:

If any cell in TIMER column = 15 then send the Range of that record (like
A4:K4) to with "NOC TIMER" in the subject line.

Help?

Thank you in advance for any help you can give me.
Gee.



Gee

Send Email If
 
I just can't figure out how to get this to fire!

It sounds so simple.

If Cell HJ2=15 send an email to

I just can't get it. Everything works fine except I can't get the code
written for that email to fire.


All times are GMT +1. The time now is 08:53 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com