Morning,
Can anyone help with the above? I just need a simple email to be sent out when a cell reaches 0
Many thanks
Morning,
Can anyone help with the above? I just need a simple email to be sent out when a cell reaches 0
Many thanks
Change A1 to suit:
And make sure to add the Outlook library in your referencesPrivate Sub Worksheet_Change(ByVal Target As Range) If Intersect(Target, Range("a1")).Value = 0 Then Dim OlApp As Object Dim OlMail As Object Set OlApp = CreateObject("Outlook.Application") Set OlMail = OlApp.CreateItem(olMailItem) OlMail.Recipients.Add "[email protected]" OlMail.Subject = "Whatever" OlMail.Body = "Insert Body Text Here" 'OlMail.attachments.add "file to path (if necessary)" OlMail.Send MsgBox "Done!" Set OlApp = Nothing Set OlMail = Nothing End If End Sub
Great thanks I'll give that a try
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks