eseelhammer
New Member
- Joined
- Jun 16, 2015
- Messages
- 1
Hello! I wrote this macro a while back and have been slowly modifying it. To be honest I am very new to VBA and have little experience.
I was hoping to edit this code so that the email is sent to multiple recipients (or CC another, either works) and also set High importance on the email
The code is as follows..
Sub ExecSubmitFile()
'
' EmpSubmitFile Macro
If Range("r1") = "" Then
MsgBox ("The name field cannot be blank. Please complete the top of the order form.")
Range("r1").Select
Else
If Range("s2") = "" Then
MsgBox ("The Location field cannot be blank. Please complete the top of the order form.")
Range("s2").Select
Else
If Range("r3") = "" Then
MsgBox ("The Department field cannot be blank. Please complete the top of the order form.")
Range("r3").Select
Else
Dim wb1 As Workbook
Dim address, Name, Loc
address = Range("l3").Hyperlinks(1).address
address = Mid(address, 8)
Name = Range("r1").Value
Loc = Range("s2").Value
Set wb1 = ActiveWorkbook
wb1.SendMail address, "EXECUTIVE Order - " & Name & " " & Loc, True
On Error Resume Next
With OutMail
.display
.OriginatorDeliveryReportRequested = True
.ReadReceiptRequested = False
End With
On Error GoTo 0
With Application
.ScreenUpdating = True
.EnableEvents = True
End With
Range("A1").Select
ActiveWorkbook.Close
End If
End If
End If
End Sub
I was hoping to edit this code so that the email is sent to multiple recipients (or CC another, either works) and also set High importance on the email
The code is as follows..
Sub ExecSubmitFile()
'
' EmpSubmitFile Macro
If Range("r1") = "" Then
MsgBox ("The name field cannot be blank. Please complete the top of the order form.")
Range("r1").Select
Else
If Range("s2") = "" Then
MsgBox ("The Location field cannot be blank. Please complete the top of the order form.")
Range("s2").Select
Else
If Range("r3") = "" Then
MsgBox ("The Department field cannot be blank. Please complete the top of the order form.")
Range("r3").Select
Else
Dim wb1 As Workbook
Dim address, Name, Loc
address = Range("l3").Hyperlinks(1).address
address = Mid(address, 8)
Name = Range("r1").Value
Loc = Range("s2").Value
Set wb1 = ActiveWorkbook
wb1.SendMail address, "EXECUTIVE Order - " & Name & " " & Loc, True
On Error Resume Next
With OutMail
.display
.OriginatorDeliveryReportRequested = True
.ReadReceiptRequested = False
End With
On Error GoTo 0
With Application
.ScreenUpdating = True
.EnableEvents = True
End With
Range("A1").Select
ActiveWorkbook.Close
End If
End If
End If
End Sub