+ Reply to Thread
Results 1 to 8 of 8

Getting Excel to send a range of data from excel via Outlook

  1. #1
    Forum Contributor
    Join Date
    11-02-2011
    Location
    Rugby, England
    MS-Off Ver
    Office 365
    Posts
    846

    Getting Excel to send a range of data from excel via Outlook

    Evening all,

    Long time since i last posted

    I'm reasonably familiar with getting VBA to send an email via outlook by attaching the workbook to the email, however i'd like to only send a range from excel in the email body.
    Here is the code i sue for emailing the worksheet:
    Please Login or Register  to view this content.
    But i'm not sure how to amend this to only send out a specific range from excel, which is H2:L24.
    Any help would be pretty bang on!

    Rich

  2. #2
    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: Getting Excel to send a range of data from excel via Outlook

    Hi Rich

    See Mr de Bruin's Code at
    https://www.rondebruin.nl/win/s1/outlook/bmail2.htm
    Need help adapting let me know.
    Last edited by jaslake; 07-13-2017 at 04:31 PM.
    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.

  3. #3
    Forum Contributor
    Join Date
    11-02-2011
    Location
    Rugby, England
    MS-Off Ver
    Office 365
    Posts
    846

    Re: Getting Excel to send a range of data from excel via Outlook

    John,
    I've had a little play with the code from the link you provided, however i'm coming across a couple of issues.
    How i've slightly changed the code:
    Please Login or Register  to view this content.
    I need to take out this line
    Please Login or Register  to view this content.
    otherwise it throws up an error "Compile Error: Sub or Function not defined".
    When that line is taken out the code appears to work on all aspects other than copying in the data range to the email, i see your sample email address in the 'To' section, i see the subject line showing what i have asked for.

    Am i missing something simple?

    Rich

  4. #4
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Getting Excel to send a range of data from excel via Outlook

    .
    Give this a try :

    Please Login or Register  to view this content.

  5. #5
    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: Getting Excel to send a range of data from excel via Outlook

    Hi Rich

    Am i missing something simple?
    I'd suggest you are...the Range to HTML Function...

    Per Mr De Bruin
    The following subroutine sends the visible cells in the selection in the body of the mail without pictures. Don't forget to copy the function RangetoHTML in the same module. You only have to change the mail address in the macro and select a few cells before you can run the macro.
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    11-02-2011
    Location
    Rugby, England
    MS-Off Ver
    Office 365
    Posts
    846

    Re: Getting Excel to send a range of data from excel via Outlook


    Ha, cant get more simple than the instructions on the initial guide...... :D

    Thanks for the input gents!

  7. #7
    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: Getting Excel to send a range of data from excel via Outlook

    You're welcome Rich...I find the Formatting of the Range (rng) needs modified a bit...Borders, etc...need help with that it's in my Tool Box...let me know...
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  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: Getting Excel to send a range of data from excel via Outlook

    You're welcome...glad I could help. 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)

Similar Threads

  1. Outlook send data to active excel sheet
    By zplugger in forum Outlook Programming / VBA / Macros
    Replies: 0
    Last Post: 08-21-2015, 06:59 AM
  2. Send data table from Excel to outlook as Email
    By praky in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-16-2014, 04:31 PM
  3. Outlook send email from data in column from excel spreadsheet
    By benasalisbury in forum Outlook Programming / VBA / Macros
    Replies: 10
    Last Post: 03-16-2012, 02:24 AM
  4. Macro to send data automatically everyhour from Excel via Outlook and out to Readers
    By Shibu_john1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-26-2010, 07:48 PM
  5. Replies: 3
    Last Post: 05-13-2010, 09:53 AM
  6. copy a data range to outlook and send e-mail
    By GaryC in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-17-2007, 01:02 PM
  7. Send a fax from within excel via outlook!
    By NSKearns in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-15-2006, 10:20 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