Thread: Question
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Bernie Deitrick Bernie Deitrick is offline
external usenet poster
 
Posts: 5,441
Default Question

Dee,

Read

Getting Started with Macros and User Defined Functions

at

http://www.mvps.org/dmcritchie/excel/getstarted.htm

and then read

Event Macros, Worksheet Events and Workbook Events

at

http://www.mvps.org/dmcritchie/excel/event.htm


HTH,
Bernie
MS Excel MVP

"Dee" wrote in message
...
Dear Bernie,

Thank you for the information. I just have a couple of questions. When you
say put the first part in the sheets module and the second part in a
regular
module. What does that mean. I don't know a lot about VBA so I'm a little
confused. I know enough to copy code and paste it into my spreadsheets and
make it work, but I'm not sure about the difference between the sheets
module
and a regular module. If i right click on the sheet and say insert module,
a
module opens. How do I get a regular module.

Thanks in advance for your help.

Best regards,

dee

"Bernie Deitrick" wrote:

Dee,

Set a reference to Outlook. Put this into the sheet's codemodule:
assumes that cell B6 has the
date, a formula references cell B6, and B7 is empty or is not equal to
"Contacted"

Private Sub Worksheet_Calculate()
If Range("B6").Value = Date And Range("B7").Value < "Contacted" Then
Call EmailMe
Range("B7").Value = "Contacted"
End If
End Sub

And put this into a regular codemodule:

Sub EmailMe()
Dim ol As Object, myItem As Object
Set ol = CreateObject("outlook.application")
Set myItem = ol.CreateItem(olMailItem)
myItem.To = "
myItem.Subject = "Check that workbook..."
myItem.Body = "Hello Dee, " & Chr(13) & Chr(13)
myItem.Body = myItem.Body & "Could you check that file for
values? " & Chr(13) & Chr(13)
myItem.Body = myItem.Body & "Thanks for doing that." & Chr(13) &
Chr(13) & Chr(13)
myItem.Body = myItem.Body & "Dee" & Chr(13)
myItem.Send
Set ol = Nothing
Set myItem = Nothing
End Sub


Note that depending on your version of Outlook, you may be prompted to
allow the sending of the
email .... a pain, but....

HTH,
Bernie
MS Excel MVP


"Dee" wrote in message
...
I have a spreadsheet where I track certain events. I have a cell where a
date
is recorded for a certain event. Is there a way to program excel so
that when
the date in the cell becomes today's date, excel will send me an email
to
alert me that I need to take action. If there is a way could you direct
me to
a website where performing this action is explained. I am using Excel
2003.

Thanks in advance for your help.

Dee