.
I already had something like this in my folder.
Paste this into a Routine Module :
Option Explicit
Sub EmailNotice()
'For Tips see: http://www.rondebruin.nl/win/winmail/Outlook/tips.htm
'Working in Excel 2000-2016
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String
Dim strTo As String
Dim strSubject As String
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
strTo = "me@yahoo.com ; you@yahoo.com; them@yahoo.com; us@yahoo.com"
strSubject = "Low Inventory Warning"
strbody = "Inventory is below 600cs. Please review" & _
" " & vbNewLine & _
"Do not respond to this email as this is an automated response message. " & _
" " & vbNewLine & _
" " & vbNewLine & _
"Sincerely, " & _
" " & vbNewLine & _
" " & vbNewLine & _
"Hal ... Your computerized messaging system." & vbNewLine & _
"( Wear nothin kin goe wrung. ) "
On Error Resume Next
With OutMail
.To = strTo
.CC = ""
.BCC = ""
.Subject = strSubject
.Body = strbody
'You can add a file like this
'.Attachments.Add ("C:\test.txt")
.Display 'If uncommented the email will display first and await user interaction
'or use .Send
'.Send 'Using .Send allows the email to send without user interaction, i.e., automatically
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
Paste this into the Sheet Level module where the <=90 will appear in Column H:
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
'Do nothing if more than one cell is changed or content deleted
If Target.Cells.Count > 1 Or IsEmpty(Target) Then Exit Sub
With Target.Range("H2:H100") '<--- change range as required
If Target.Value <=90 Then
'Stop any possible runtime errors and halting code
On Error Resume Next
'Turn off ALL events so the Target * 2 does not _
'put the code into a loop.
Application.EnableEvents = False
EmailNotice 'calls the email macro
'Turn events back on
Application.EnableEvents = True
'Allow run time errors again
On Error GoTo 0
End If
End With
'End If
End Sub
Bookmarks