User Contributed Macros > Mail Notification

Mail Notification

Tags:  

The following code is used to send an email if certain values of your worksheet meet the desired criteria. This is useful for collaborative editing and dynamic data.
Private Sub Worksheet_Change(ByVal Target As Range) 
 Application.EnableEvents = false
 On Error Goto ENEV
 If(Target.Address="$C$10" And IsNumeric(Target.Value) And Target.Value>=1000) Then
    ThisWorkbook.HasRoutingSlip = True
    With ThisWorkbook.RoutingSlip
       .Recipients = Array("$mailid") ' Enter mail ids seperated by comma
       .Subject = "$subject"          ' Enter your subject here
       .Message = "$message"          ' Enter your message here 
    End With
    ThisWorkbook.Route
 End If
 ENEV:
Application.EnableEvents = true
End Sub 


 RSS of this page