+ Reply to Thread
Results 1 to 3 of 3

VBA to Email Selected Email Addresses

  1. #1
    Registered User
    Join Date
    12-20-2012
    Location
    California, US
    MS-Off Ver
    Excel 2007
    Posts
    3

    VBA to Email Selected Email Addresses

    I have been reading this forum for a couple of days now and have not been able to (1) find an answer to my subject question or (2) put the pieces together to answer my question. This has given me the opportunity (or forced me?) to join the forum!

    As stated in the Subject, I am trying to create a Button that, when pressed, will open a blank Outlook email dialogue box with the email addresses selected inserted into the "To" input.

    Just as some background, I am creating an Excel spreadsheet with contact information. On of the fields (table column) is email addresses. I want to be able to select (highlight) multiple email addresses and press an "email" button that will take those selected email addresses and stuff them into the "To" portion of a blank Outlook email.

    My Status: I have found MANY posts on this forum that talk about emailing the selected rows/columns to an unspecified addresses (i.e., they stuff the selection into the body). I tried to take this concept and use it to simply stuff the selection into the "To" section instead of the "Body," but for some reason cannot get it to work.

    I use the "Selection" method of VBA, which works great when one email is selected, but once I have more than one, it breaks. I cannot figure out how to (1) loop through the multiple selected cells or (2) how to store the multiple selected cells as an array. (If I could get it as an array, I would not how to loop through it; but if that is not a good approach, I'm all ears!)

    Thanks!

    -Nick

  2. #2
    Registered User
    Join Date
    12-20-2012
    Location
    California, US
    MS-Off Ver
    Excel 2007
    Posts
    3

    Question Re: VBA to Email Selected Email Addresses

    I would like to bump this post and add that I have semi-answered my question. Here is the code I am using to loop through my selection:

    Please Login or Register  to view this content.
    The problem, however, is that this requires my selection (i.e., highlighted cells) to be in consecutive rows. I'd like to be able to have my selection be sparse.

    Is there anyway to Go to the next cell in the selection by using the "Selection" method? If so, how?

    Thanks!

  3. #3
    Registered User
    Join Date
    12-20-2012
    Location
    California, US
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: VBA to Email Selected Email Addresses

    Ah! Found my fix!!! It was easier than what I thought... if only I understood VBA better then I wouldn't have had to post a question...

    Here's my fix for those of you who are interested:

    Please Login or Register  to view this content.
    And my full code for anyone else interested in emailing multiple people from your Excel contact sheet:

    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)

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