Hey,
i have entered the following code and have absolutely no trouble executing, however, i dont know how to move it to the next row and perform the macro again. it basically is for sending emails....also i would like to update the excel sheet once the email is sent automatically...to say email sent.
your help would be greatly appreciated.
i have entered the following code and have absolutely no trouble executing, however, i dont know how to move it to the next row and perform the macro again. it basically is for sending emails....also i would like to update the excel sheet once the email is sent automatically...to say email sent.
Code:
Sub Email_Notification()
Dim OutlookApp As Object
Dim OutlookMail As Object
Dim ToName As String
Dim CCName As String
Dim SendEmail As Integer
Dim cell As Range
ToName = Range("N9").Value
CCName = Range("P9").Value
mAttName = Range("C9").Value
Application.ScreenUpdating = False
SendEmail = MsgBox("Do you want to send the following Email?" _
& vbNewLine & vbNewLine & "Subject: " & SubName & vbNewLine & vbNewLine & _
"To: " & ToName & vbNewLine & _
"CC: " & CCName & vbNewLine & _
"With the following Attachments: " & vbNewLine & Range("C9").Value, _
vbQuestion + vbYesNo, "Send Email")
If SendEmail = vbYes Then
End If
Set OutlookApp = CreateObject("Outlook.application")
Set OutlookMailitem = OutlookApp.CreateItem(0)
With OutlookMailitem
.Display
.To = Range("N9").Value
.CC = Range("P9").Value
.Subject = "TMT-KSD File Review Request"
.HTMLBody = Body & Attachment
.Body = "Kindly review the attached file for TMT-KSD upload." & vbNewLine & "Regards."
.Attachments.Add Range("L9").Value
.send
End With
Set OutlookMail = Nothing
Set OutlookApp = Nothing
Application.ScreenUpdating = True
End Sub
Last edited by a moderator: