Using Office 2013
I am trying to create a macro that will create an outlook email, copy several pivot tables (all have named ranges) from three different sheets within a workbook then paste them along with text that falls above and between some of the tables into the body of the email. It will also attach a copy of the report and use distribution lists from two different named ranges containing the recipients for the To: and CC: fields.
I have tried using and modifying the code from Ron de Bruin's website, but it's not working. It creates the email with the attachment & recipients but the body of the email is empty.
The email layout and code are below and a screenshot pic is attached.
Layout:BODY TEXT LINE1 MM-DD-YYYY (TEXT SHOULD BE HIGHLIGHTED AND BOLDED).*
BODY TEXT LINE2 ## (TEXT SHOULD BE HIGHLIGHTED AND BOLDED) .*ABCDEFHIJKLMNOP.
*
BODY TEXT LINE3 ABC – ABCDEFJHIJKLMNOP.*
*
BODY TEXT LINE4.*
*
BODY TEXT LINE5.*
SHEET1.TABLE1
BODY TEXT LINE2
SHEET2.TABLE2
SHEET2.TABLE3
SHEET3.TABLE4
SHEET3.TABLE5
VBA Code
Function Code
EmailBodySample.jpg
Bookmarks