+ Reply to Thread
Results 1 to 6 of 6

VBA Code to select Range of cells as Email Body In Outlook

  1. #1
    Forum Contributor
    Join Date
    09-05-2012
    Location
    Dubai
    MS-Off Ver
    Office 365
    Posts
    406

    VBA Code to select Range of cells as Email Body In Outlook

    Hi dears i have done a small VBA Code to send the current file as attachment through Outlook.

    file is successfully attached and mail is been sent.

    But my problem is i am unable to fill Body in Mail.

    please find attached i want to select range A1:D18 in sheet (Table) as BODY to my Email.

    code i mentioned below is not working. pls help

    ' .body = ActiveWorkbook.Sheets("Table").Range("A5")
    .body = ActiveWorkbook.Sheets("Table").Range("A1:D18")



    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    08-09-2012
    Location
    Anch, Alaska
    MS-Off Ver
    2003, 2010, 2013
    Posts
    131

    Re: VBA Code to select Range of cells as Email Body In Outlook

    The additional code will do what your looking for, give it a try.
    Attached Files Attached Files
    Give Credit When Credit Is Due - Click On the Star
    Be Sure To Mark Your Post [Solved] When You Get Your Answer

  3. #3
    Forum Contributor
    Join Date
    09-05-2012
    Location
    Dubai
    MS-Off Ver
    Office 365
    Posts
    406

    Re: VBA Code to select Range of cells as Email Body In Outlook

    Dear Buck its working good now, thanks for your help

  4. #4
    Registered User
    Join Date
    09-12-2013
    Location
    Midlands, England
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: VBA Code to select Range of cells as Email Body In Outlook

    I am having a similar issue I am trying to send the info from cells A1:G38 as the body of my email.

    I need two options to send the same data one for a day shift one for a night shift as the subject line will change but the format will not. My code sends the email just that the body of the email is always blank? any ideas? Also when I add the second function (Night shift) the macro doesn't run. Thank you in advance.
    PLC Shift report.xlsm

  5. #5
    Registered User
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,164

    Re: VBA Code to select Range of cells as Email Body In Outlook

    TC922,

    Unfortunately you need to post your question in a new thread, it's against the forum rules to post a question in the thread of another user. If you create your own thread, any advice will be tailored to your situation so you should include a description of what you've done and are trying to do. Also, if you feel that this thread is particularly relevant to what you are trying to do, you can surely include a link to it in your new thread.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  6. #6
    Registered User
    Join Date
    09-12-2013
    Location
    Midlands, England
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: VBA Code to select Range of cells as Email Body In Outlook

    I am sorry I meant to create a new thread, with a reference to this post.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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