E - Mail triggering from Excel...

  • Thread starter Thread starter Neil
  • Start date Start date
N

Neil

Hi All,

Once per week we enter stock figures into a spreadie that then advises how
many units should be manufactured for that week.

This is done at the production plant level.

If upon entering the weeks starting stock figure we trigger one of the
limits (max or min), I'd like the spreadie (via macro) to
send an E - Mail to the stock co - ordinator so that he can look into the
alarm event.

How might this be done and / or where can I find helpful information to get
started ?

Thanks for your assistance.

David
 
David,

In order to do that, you'll have to use an event that captures changes to
the spreadsheet so that it can evaluate the number entered. (I'm assuming
you want the email sent when one value is entered into a cell.)

You can use code somewhat similiar to the below. The SheetChange even
monitors the value of the target cell. So if the value entered is either
the min or max an email will be sent.

You'll have to, of course, figure out how to write the email application
code. In this case I used Outlook.

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)

Dim oMail As Outlook.Application

Set oMail = New Outlook.Application

'reached max
If Target.Value = 10 Then
'send email
End If

'reached min
If Target.Value = 1 Then
'send email
End If
End Sub

Let me know if that helps any.

Chris
 
**** excel in the mouth.. i mean-- it doesnt work for real data entry.

build a simple webpage to do this AND STORE YOUR DATA IN A DATABASE not
in Excel.
 
Back
Top