+ Reply to Thread
Results 1 to 8 of 8

Pasting Range from worksheet into Body of Email Message

  1. #1
    Registered User
    Join Date
    10-18-2010
    Location
    Arizona, USA
    MS-Off Ver
    Excel 2007, 2010
    Posts
    7

    Pasting Range from worksheet into Body of Email Message

    I want it to take a set range on a specified worksheet and paste it into the body of an email and send it off. Then close the workbook without saving. I have some code that works, but only about 40% of the time. I've tried it on Excel 2007 & 2010 and cannot consistantly get the range to paste. Any assistance would be greatly appreciated. Here is the code:

    Please Login or Register  to view this content.
    Last edited by AZGryphon; 02-10-2012 at 06:25 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    10-21-2011
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    513

    Re: Pasting Range from worksheet into Body of Email Message

    I am leaving work soon, but if you can post a dummy workbook, I will see if I can help.

    I was just troubleshooting Excel/Outlook macro earlier today.

    Thanks

  3. #3
    Registered User
    Join Date
    10-18-2010
    Location
    Arizona, USA
    MS-Off Ver
    Excel 2007, 2010
    Posts
    7

    Re: Pasting Range from worksheet into Body of Email Message

    Here is a dummy form.
    Attached Files Attached Files

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Pasting Range from worksheet into Body of Email Message

    Hi AZGryphon
    Please wrap your code in code tags. To edit your post, press Edit Post, press Go Advanced to see the [#] button). Highlight your code then press the [#] button. Press Save Changes.
    Then, see this link http://www.rondebruin.nl/mail/folder3/mail4.htm
    I've used this code many times and it works wonderfully well. If you need help adapting the code, let me know.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  5. #5
    Registered User
    Join Date
    10-18-2010
    Location
    Arizona, USA
    MS-Off Ver
    Excel 2007, 2010
    Posts
    7

    Re: Pasting Range from worksheet into Body of Email Message

    Thanks for the help John! An additional question though. It doesn't work if I have the worksheet protected, is there a way around that?

  6. #6
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Pasting Range from worksheet into Body of Email Message

    Hi AZGryphon
    You can do a couple of things.
    You can unprotect the sheet (with code), allow the procedure to run, then protect the sheet (with code).
    Or, you can place this kind of code in the Workbook Module such that it'll allow macros to run on a protected sheet.
    Please Login or Register  to view this content.
    If you decide to use the above code and don't use password protection, remove the lines that refer to password protection. You'll need to save and close the workbook then reopen to allow the macro be operational.

  7. #7
    Registered User
    Join Date
    10-18-2010
    Location
    Arizona, USA
    MS-Off Ver
    Excel 2007, 2010
    Posts
    7

    Re: Pasting Range from worksheet into Body of Email Message

    Thanks for the assistance!

  8. #8
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Pasting Range from worksheet into Body of Email Message

    Hi AZGryphon

    You're welcome...glad I could be of help...and thanks for the Rep.

+ 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