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.