I have created a VBA that works really well, with the exception of the Email_Send, I need it to send from a different email address (that I have access to), however it just continues to send from mine... help!
Code below:
Private Sub CommandButton1_Click()
On Error Resume Next
Dim x As Integer
x = 13
Do While x < 2000
If Range("R" & x).Value = "Yes" Then
Dim Email_Subject, Email_Send_From, Email_Send_To, _
Email_Cc, Email_Bcc, Email_Body As String
Dim Mail_Object, Mail_Single As Variant
Email_Subject = "Welcome Back - " & Range("B" & x).Value
Email_Send_From = "differentaddress@help.com.au"
Email_Send_To = Worksheets("Current List").Range("P" & x).Value
Email_Body = "TO: " & Range("B" & x).Value & " and Crew" & Worksheets("Email").Range("A1").Value
On Error GoTo debugs
Set Mail_Object = CreateObject("Outlook.Application")
Set Mail_Single = Mail_Object.CreateItem(0)
With Mail_Single
.Subject = Email_Subject
.To = Email_Send_To
.cc = Email_Cc
.BCC = Email_Bcc
.body = Email_Body
.sent
End With
debugs:
If Err.Description <> "" Then MsgBox Err.Description
y = Range("S" & x).Value
Worksheets("Master").Range("C" & y).Value = Worksheets("Current List").Range("B2").Value
Else
End If
x = x + 1
Loop
End Sub
Code below:
Private Sub CommandButton1_Click()
On Error Resume Next
Dim x As Integer
x = 13
Do While x < 2000
If Range("R" & x).Value = "Yes" Then
Dim Email_Subject, Email_Send_From, Email_Send_To, _
Email_Cc, Email_Bcc, Email_Body As String
Dim Mail_Object, Mail_Single As Variant
Email_Subject = "Welcome Back - " & Range("B" & x).Value
Email_Send_From = "differentaddress@help.com.au"
Email_Send_To = Worksheets("Current List").Range("P" & x).Value
Email_Body = "TO: " & Range("B" & x).Value & " and Crew" & Worksheets("Email").Range("A1").Value
On Error GoTo debugs
Set Mail_Object = CreateObject("Outlook.Application")
Set Mail_Single = Mail_Object.CreateItem(0)
With Mail_Single
.Subject = Email_Subject
.To = Email_Send_To
.cc = Email_Cc
.BCC = Email_Bcc
.body = Email_Body
.sent
End With
debugs:
If Err.Description <> "" Then MsgBox Err.Description
y = Range("S" & x).Value
Worksheets("Master").Range("C" & y).Value = Worksheets("Current List").Range("B2").Value
Else
End If
x = x + 1
Loop
End Sub