+ Reply to Thread
Results 1 to 2 of 2

VBA Code Used to Split off Worksheets and email them. Can I add text to the body of email

  1. #1
    Registered User
    Join Date
    06-21-2012
    Location
    Santa Fe Springs, CA
    MS-Off Ver
    Excel 2010
    Posts
    6

    Red face VBA Code Used to Split off Worksheets and email them. Can I add text to the body of email

    Some years ago I was assisted by your site with the following VBA code which splits off excel worksheets and emails it to the email contained in cells K1:k2. This has been working for me for years perfectly! And an incredible time saver!

    Sub EmailReport()
    'copy each sheet into a new workbook
    'and email it to the address in cells K1:K2
    For i = 1 To Sheets.Count
    Sheets(i).Select
    Sheets(i).Copy
    ActiveWorkbook.SendMail Recipients:=Range("K1:K2").Value, Subject:="DAILY STATUS REPORT"
    ActiveWindow.Close SaveChanges:=False
    Next

    End Sub

    Private Sub Workbook_Open()

    End Sub

    My question is: Can I add narrative to the body of the outgoing email?

    It's awesome that I can adjust the Subject Line of the email. I've been using the subject line to contain anything I wish to convey to the recipient. As an example: "Daily Status Report. February results for your review and approval. Please reply by Friday, March 29, 2024."

    This sometimes makes for a very long subject line. I was wondering if I could just update the code in some way so that this information actually goes into the body of the email instead of on the subject line?

  2. #2
    Valued Forum Contributor
    Join Date
    11-29-2022
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    430

    Re: VBA Code Used to Split off Worksheets and email them. Can I add text to the body of e

    Not using the SendMail method. You would have to implement an entirely new way of sending email. This link can get you started - https://www.simplilearn.com/tutorial...email-in-excel
    Last edited by thomglea; 03-28-2024 at 03:43 PM. Reason: adding link

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Generating Outlook Email and inseting chart into email with Text body.
    By Hyperion1571 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-17-2019, 12:41 PM
  2. [SOLVED] Extract Month and year in VBA Code to email in body of email
    By Howardc1001 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-10-2019, 02:30 PM
  3. Code to send email with table on the email body via gmail
    By ivhee00 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-19-2017, 12:24 AM
  4. [SOLVED] VBA to send email using data from the EXCEL including email address, subject and body text
    By ec4excel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-18-2016, 11:07 AM
  5. Excel code to email whats in the spreadsheet in the body of email
    By Kain93 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-18-2012, 09:55 AM
  6. Replies: 4
    Last Post: 02-29-2012, 08:14 PM
  7. Replies: 4
    Last Post: 02-27-2012, 03:13 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1