+ Reply to Thread
Results 1 to 12 of 12

Selecting Multiple Email Addresses

  1. #1
    Registered User
    Join Date
    08-17-2017
    Location
    USA
    MS-Off Ver
    2016
    Posts
    29

    Selecting Multiple Email Addresses

    Can anyone help with modifying this code to select multiple email addresses that are in a list in excel rather than having to hard code an email into VBA?

    Sub Send_Range()

    ' Select the range of cells on the active worksheet.
    ActiveSheet.Range("A1:B5").Select

    ' Show the envelope on the ActiveWorkbook.
    ActiveWorkbook.EnvelopeVisible = True

    ' Set the optional introduction field thats adds
    ' some header text to the email body. It also sets
    ' the To and Subject lines. Finally the message
    ' is sent.
    With ActiveSheet.MailEnvelope
    .Introduction = "This is a sample worksheet."
    .Item.To = "E-Mail_Address_Here"
    .Item.Subject = "My subject"
    .Item.Send
    End With
    End Sub

    Thanks!

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

    Re: Selecting Multiple Email Addresses

    .
    Here's an example to work with that includes attachments as well listed in Col B:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    08-17-2017
    Location
    USA
    MS-Off Ver
    2016
    Posts
    29

    Re: Selecting Multiple Email Addresses

    Thanks I was trying to use the envelope feature to create and send the email because I would ultimately like to copy a range of cells and paste special the picture of that copy into the email.

    I already have the code below that works with the email list and does everything like I expect it to but I can't seem to get the same concept to work with the envelope feature.

    Maybe the question I should be asking is how can I paste special a picture of a copied range of cells into the email in the code below?

    Please Login or Register  to view this content.

    Also on another note when sharing code in the message how do I get it into the separate box like you did?

    THANKS!
    Last edited by uvebeenwarrened; 08-17-2017 at 05:29 PM.

  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,015

    Re: Selecting Multiple Email Addresses

    .
    When you click on the HASH MARK symbol, it creates this : (CODE)(/CODE)"

    First click on the HASH symbol, then create a blank line between the two so it looks like this:

    (CODE)

    (/CODE)

    Then paste your code in the blank line.

    The words CODE and /CODE will actually be surrounded by these symbols [ ] . I couldn't use those in the explanation above
    because it would not have displayed correctly for the explanation. Here's an example of what I mean :

    Please Login or Register  to view this content.

    You don't actually see the words CODE & /CODE


    To the point of your question .. let me review the code. I've not had much luck with sending email via ENVELOPE method.

  5. #5
    Registered User
    Join Date
    08-17-2017
    Location
    USA
    MS-Off Ver
    2016
    Posts
    29

    Re: Selecting Multiple Email Addresses

    Thanks!

    Please Login or Register  to view this content.

  6. #6
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Selecting Multiple Email Addresses

    Welcome to the forum!

    Drop Envelope method.

    Be sure to download Ron's routine as commented.

    e.g.
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    08-17-2017
    Location
    USA
    MS-Off Ver
    2016
    Posts
    29

    Re: Selecting Multiple Email Addresses

    Thanks Ken. I like the Drop Envelope method other than I would like the email addresses to be selected from a list in excel rather than having to hard code them into VBA every time they change and I can't seem to figure out how to make that work. Plus I will want to send to multiple emails at once.

    What do you mean download Ron's routine as commented?

  8. #8
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Selecting Multiple Email Addresses

    RangeToHTML() is a custom routine. No sense posting it since Ron does on his site.

  9. #9
    Registered User
    Join Date
    08-17-2017
    Location
    USA
    MS-Off Ver
    2016
    Posts
    29

    Re: Selecting Multiple Email Addresses

    Gotcha, thanks. I have looked through Ron's site. I tried to find this myself before asking on here with no luck. I can't seem to find how to do both copy a range from Excel and paste as a picture in Outlook and also send to a list of emails rather than having to hard code it into the actual VBA code. I asked because I thought you meant that there was something I was missing that you had already commented on a routine to copy from Ron's site. Are you familiar with where to find what I am trying to do on Ron's site already? I found similar things on there and bits in pieces that have helped but I can't seem to pull it all together to accomplish the whole goal.

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

    Re: Selecting Multiple Email Addresses

    .
    Here is an example and sample workbook.

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

  11. #11
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Selecting Multiple Email Addresses

    To get back to your original question, it depends on your data. Is the range of emails in a row, column, both, a listbox, etc.

  12. #12
    Registered User
    Join Date
    08-17-2017
    Location
    USA
    MS-Off Ver
    2016
    Posts
    29

    Re: Selecting Multiple Email Addresses

    Thanks Logit. I'm going to try to incorporate some of this code and see if I can get it to work.

    Ken-Currently the email addresses are manually typed into a column. The same starting point for the list is used all the time but the emails themselves of the number of emails change every time.
    Last edited by uvebeenwarrened; 08-17-2017 at 05:34 PM.

+ 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: 3
    Last Post: 11-29-2014, 07:30 AM
  2. Multiple email addresses in a cell for email merge use
    By selinaang3012 in forum Excel General
    Replies: 0
    Last Post: 03-11-2013, 05:59 AM
  3. sending email by selecting from a lsit of addresses
    By modytrane in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-03-2010, 01:13 PM
  4. email excel file or worksheet as an attachment to multiple email addresses
    By jgeagle5 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-16-2009, 03:40 PM
  5. Sending an email from Excel to multiple email addresses
    By insanity66 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-14-2009, 02:01 PM
  6. Replies: 5
    Last Post: 07-23-2009, 03:01 AM
  7. edit, save as new and email to multiple email addresses
    By murphyx232 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-20-2007, 02:37 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