Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Time Problem | Excel Discussion (Misc queries) | |||
Time Sheet Calculation Help Needed! | Excel Worksheet Functions | |||
mulitiplying time | Excel Worksheet Functions | |||
Calculating tvl time in Excel 2000 Rev.9.2720 | Excel Worksheet Functions | |||
entering numbers to display a time format | Excel Discussion (Misc queries) |