View Single Post
  #1   Report Post  
yh73090
 
Posts: n/a
Default Warning! Time has expired....


Help!!!
I've been given a spreadsheet and asked to come up with a way to have
an alert sent via email when the difference between two dates expires.
Well I found the code for sending an email, but it needs to be
triggered by clicking a button.
This is the code I have for this: (Continued request below Code)

Sub Email()
Dim oApp
Dim oMess
Dim eRange As Range
Dim i As Long

Application.ScreenUpdating = False
Set oApp = CreateObject("Outlook.Application")
Set eRange = Range("A1")
Do
Set oMess = oApp.CreateItem(0)
With oMess
.To = eRange.Offset(i, 0)
.Subject = "Your time has expired"
.Body = "Joe, Moe, and Larry" & vbNewLine & vbNewLine & _
"Please goto the Stooges spreadsheet and handle the
problem."
.send
End With
Set oMess = Nothing
i = i + 1
'stop on the first blank cell in column a or b etc
Loop While eRange.Offset(i, 0) ""

Set oApp = Nothing
Application.ScreenUpdating = True
End Sub

My second question is how to create a expiration date, I am looking for
the number of workdays between two dates.

Thank you so much for all your help.
Yo


--
yh73090
------------------------------------------------------------------------
yh73090's Profile: http://www.excelforum.com/member.php...fo&userid=7510
View this thread: http://www.excelforum.com/showthread...hreadid=483702