Kimberly47
New Member
I have a code to autogenerate an email if a change is made to cells e11:a33. If I make several changes, I'd only like it to autogenerate the email once. How can I do this? Thanks,
<< Use Code -tags >>
<< Use Code -tags >>
Code:
Dim xRg As Range
'Update by Extendoffice 2018/3/7
Private Sub Worksheet_Change(ByVal Target As Range)
'Determine if change was made to cells E11:E33
If Not Intersect(Target, Range("E11:E33")) Is Nothing Then
Call Mail_small_Text_Outlook
End If
End Sub
Sub Mail_small_Text_Outlook()
Dim xOutApp As Object
Dim xOutMail As Object
Dim xMailBody As String
Set xOutApp = CreateObject("Outlook.Application")
Set xOutMail = xOutApp.CreateItem(0)
xMailBody = "LAC team," & vbNewLine & vbNewLine & _
"This LAC Event Management Macro for _ has a status update. Please review. Thanks."
On Error Resume Next
With xOutMail
.To = ""
.CC = ""
.BCC = ""
.Subject = "Event Planning Update"
.Body = xMailBody
.Display 'or use .Send
End With
On Error GoTo 0
Set xOutMail = Nothing
Set xOutApp = Nothing
End Sub