+ Reply to Thread
Results 1 to 7 of 7

Excel Macro - Send Email from Worksheet

  1. #1
    Registered User
    Join Date
    08-16-2017
    Location
    Madison, WI
    MS-Off Ver
    2011
    Posts
    20

    Excel Macro - Send Email from Worksheet

    Hello!

    I'm hoping for some help. I'm trying to send a worksheet through a macro. i have a cell in the sheet with the staff member's email address and I'd like to click the macro button and have just page 1 of the current tab attached to an outlook email and have the to line filled in based on the cell that the address is located in. Subject and body can remain blank.

    This is an attendance tracker that each supervisor can share at their discretion so this button will greatly help streamline the process. I have a very basic macro already created that creates an email but it still doesn't auto populate the address. Any help would be GREATLY appreciated. Macros are WAY over my head. I have the current version of this sheet attached.

    All the best,
    Mark
    Attached Files Attached Files

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: Excel Macro - Send Email from Worksheet

    Check it out.

    http://www.rondebruin.nl/win/s1/outlook/amail2.htm

  3. #3
    Registered User
    Join Date
    08-16-2017
    Location
    Madison, WI
    MS-Off Ver
    2011
    Posts
    20

    Re: Excel Macro - Send Email from Worksheet

    That's NEARLY perfect - but I don't want to have to go in to EVERY sheet to change the email address - I want the macro to read it from a cell on the sheet. Basically when I push this out to all supervisors in my agency I don't want to have to PHYSICALLY walk them through every tab for their employees and hunt through code to change the email address OR rely on them to do it which will likely result in messed up code.

  4. #4
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Excel Macro - Send Email from Worksheet

    http://www.rondebruin.nl/win/s1/outlook/amail5.htm

    replace
    Please Login or Register  to view this content.
    with
    Please Login or Register  to view this content.
    ps
    also change

    .Send to .Display

    while you are testing otherwise every time you test it ...it will actually send out actual emails
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  5. #5
    Registered User
    Join Date
    08-16-2017
    Location
    Madison, WI
    MS-Off Ver
    2011
    Posts
    20

    Re: Excel Macro - Send Email from Worksheet

    Tried that - it turned my "to" line red and won't run correctly. It displays as .To = "sh.Range("c3").Value" but in red font. newest version is attached...I'm at a loss because I'm just not familiar with this...any thoughts?
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    12-14-2016
    Location
    UAE
    MS-Off Ver
    MS OFFICE 2016 & 2019
    Posts
    154

    Re: Excel Macro - Send Email from Worksheet

    Try this if it works for you :
    Please Login or Register  to view this content.
    Attached Images Attached Images

  7. #7
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Excel Macro - Send Email from Worksheet

    A. you didnt use the code in the link i pasted but keep your original one that Dave suggested instead
    Dave's version does not loop thru the workbook to go thru every sheet like you requested in post #3

    B. you put code as
    Please Login or Register  to view this content.
    instead of
    Please Login or Register  to view this content.
    note the extra " you put in
    it changes it from the value of C3 to exactly "sh.Range("c3").Value" which is an invalid email address

    see below updated code with some of your customisations

    Please Login or Register  to view this content.

+ 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. Replies: 4
    Last Post: 01-30-2016, 02:13 PM
  2. Macro to send worksheet via email automatically and find text instead of numbers
    By parrisD in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-31-2015, 11:48 AM
  3. Macro send worksheet as email attachment?
    By welshman010 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-19-2014, 09:36 PM
  4. Macro to send individual tabs from a worksheet to different email address based on in
    By mikeyexcel in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-30-2014, 07:46 PM
  5. Replies: 11
    Last Post: 05-26-2013, 07:45 AM
  6. Excel Email Macro VBA - How to send an email once all required fields have been fille
    By wallacm2009 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-01-2012, 10:51 AM
  7. Macro to send active worksheet to different email addresses
    By Benjamin2008 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-10-2010, 07:53 PM

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