I am not sure if that would trigger a change event. If it does:
1. Put first into the worksheet, right click sheet tab, View Code, and paste.
2. Put 2nd into a Module. Add the Outlook object in Tools > References.
3. Enter value greater than 100 in column A to trigger the event.
4. Change max value and column to suit in (1).
5. Uncomment MailIt line in (1) and add your SMS info for your cell's carrier.
6. Uncomment Exit Function line in (1) if you want all changes that might occur at once.
Sheet Code:
Private Sub Worksheet_Change(ByVal Target As Range) Dim r As Range, c As Range, calc As Integer, max As Long
max = 100
Set r = Intersect(Target, Range("A1", Cells(Rows.Count, "A").End(xlUp)))
If r Is Nothing Then Exit Sub
With Application
.ScreenUpdating = False
.EnableEvents = False
calc = .Calculation
.Calculation = xlCalculationManual
End With
For Each c In r
If c.Value > max Then _
Application.Speech.Speak c.Value & " exceeded the maximum of " & max & " in cell " & c.Address(False, False) & ".", True
'MailIt "5555555555@vtext.com", "Exceeded Max", "Cell " & c.Address(False, False) & " value was " & c & "."
GoTo EndNow
Next c
EndNow:
With Application
.ScreenUpdating = True
.EnableEvents = True
.Calculation = calc
End With
End Sub
Module code:
Sub MailIt(sEmail As String, sSubject As String, sBody As String) Dim oMailItem As Object, oRecipient As Object
Dim OLApp As Outlook.Application
Dim NewTask As Outlook.TaskItem
' Set the Application object
Set OLApp = New Outlook.Application
Set oMailItem = OLApp.CreateItem(0)
Set oRecipient = oMailItem.Recipients.Add(sEmail)
oRecipient.Type = 1
With oMailItem
.Subject = sSubject
.Body = sBody
.Display 'To test, uncomment and comment next line
'.Send
End With
End Sub