Email Generation Using Macro - Body Issues

1204Brown

New Member
Joined
May 18, 2014
Messages
1
Trying to add a macro to generate an approval email with certain data from the spreadsheet within the body of the email.
I have the following in place currently to deploy the email:

Sub Sendemail()


Dim Email_Subject, Email_Send_To, _
Email_Cc, Email_Body As String
Dim Mail_Object, Mail_Single As Variant
Email_Subject = "New Account Approval"
Email_Send_To = "christina@TESTINGXYZ.com"
Email_Cc = "sales@TESTINGXYZ.com"
Email_Body = "The following New Account requires your approval:."
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
.Body = Email_Body
.send
End With
debugs:
If Err.Description <> "" Then MsgBox Err.Description
End Sub

What do I need to add the following cell values into the body of the email, All Sheet 1?
B6
B4
B8
F14
E16 : F16
E17 : F17
A25 : B25
A26 : B26
A27 : B27

Is there something simple I can insert to make this work?

Thank you so much!
Christina
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Change the body to refer to your cells.
Code:
.Body = Email_Body & Range("B6").Value & " " & Range("B4").Value & " " & Range("B8").Value & _
" " & Range("F14").Value & " " & Range("E16:F16").Value & " " & Range("E17:F17").Value & _
" " & Range("A25:B25").Value & " " & Range("A26:B26").Value & " " & Range("A27:B27").Value

....but I'd suggest putting a formula in another cell and joining the text in that one cell and referring to it in the body

Code:
=B6&" " &B4&" "&B8&" "&F14&" "&E16&" "&F16&" "&E17&" "&F17&" "&A25&" "&B25&" "&A26&" "&B26&" "&A27&" "&B27
 
Last edited:
Upvote 0
Darn it....another typo

Code:
.Body = Email_Body & Range("B6").Value & " " & Range("B4").Value & " " & Range("B8").Value & _
" " & Range("F14").Value & " " & Range("E16") & " " & Range("F16").Value & " " & Range("E17").Value & " " & Range("F17").Value & _
" " & Range("A25").Value & " " & Range("B25").Value & " " & Range("A26").Value & " " & Range("B26").Value & " " & Range("A27").Value & " " & Range("B27").Value
 
Upvote 0

Forum statistics

Threads
1,215,047
Messages
6,122,858
Members
449,096
Latest member
Erald

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top