Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Gee Gee is offline
external usenet poster
 
Posts: 32
Default 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.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default 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.


  #3   Report Post  
Posted to microsoft.public.excel.programming
Gee Gee is offline
external usenet poster
 
Posts: 32
Default 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.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default 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.


  #5   Report Post  
Posted to microsoft.public.excel.programming
Gee Gee is offline
external usenet poster
 
Posts: 32
Default 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.




  #6   Report Post  
Posted to microsoft.public.excel.programming
Gee Gee is offline
external usenet poster
 
Posts: 32
Default 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.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
send email to each customer email in excel sheet. -keevill- Excel Discussion (Misc queries) 3 July 17th 08 02:33 PM
Excel VBA macro to send email attachment from default email client wifigoo Excel Programming 2 April 12th 08 03:54 PM
Send data from Excel in email from specific email address Erik Excel Programming 5 December 5th 07 05:09 PM
send wkbk as an email attachment with an email address copied from SueInAtl Excel Discussion (Misc queries) 0 May 21st 07 10:53 PM
send email with email addresses in a range of cells Craig[_24_] Excel Programming 1 October 10th 05 09:26 PM


All times are GMT +1. The time now is 11:14 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"