+ Reply to Thread
Results 1 to 3 of 3

Creating Multiple Emails from same cells in a sheet

  1. #1
    Registered User
    Join Date
    03-13-2012
    Location
    United States
    MS-Off Ver
    Office Professional Plus 2013
    Posts
    19

    Creating Multiple Emails from same cells in a sheet

    I am trying to combine 2 different VBA macros that I've found on this forum (I think) into 1. The first part of the macro changes the values in 4 cells on Sheet "Email Message", based on 1 vlookup cell. The 2nd part of the macro creates an email based off of the values of those cells, and then saves it as a draft. Unfortunately, I can't get the macro to cycle through all of the values and generate more than 1 email. It seems to me like once it gets to Outlook, the code doesn't make it back to Excel to continue cycling through the code.

    I know I'm doing a terrible job describing this, so hopefully the attachment and code can be of some help.

    Please Login or Register  to view this content.
    Outlook Draft Email Macro - Forum Help.xlsm

    Thanks!

  2. #2
    Registered User
    Join Date
    03-13-2012
    Location
    United States
    MS-Off Ver
    Office Professional Plus 2013
    Posts
    19

    Re: Creating Multiple Emails from same cells in a sheet

    Hopefully I can clarify my objective:

    I created a "template" of information to be used as the source for each email. These cells (let's call them EmailValues) are linked to a lookup cell. As the lookup cell is changed, the EmailValues adjust. I am trying to get my macro to automatically cycle through each option in the lookup cell, create an email using the (then) current EmailValues, save and close that email draft, and then move on to the next lookup cell value, and repeat the email creation process.

    I'm having trouble determining where my code is breaking down. When I run the code above, I only get 1 email draft (the last option in my range A2:A5, I get the cell.value of A5) when I'm expecting 4 emails (A2:A5).

  3. #3
    Registered User
    Join Date
    03-13-2012
    Location
    United States
    MS-Off Ver
    Office Professional Plus 2013
    Posts
    19

    Re: Creating Multiple Emails from same cells in a sheet

    I found my issue. The order of the Set code is important. The code below works, with the highlighted section being what I adjusted.
    Please Login or Register  to view this content.
    I added the On Error Resume Next in case there was no attachment for an item.

+ 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. Send excel sheet to multiple emails according to the date and time set
    By Nadrose in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-24-2014, 11:09 PM
  2. [SOLVED] Macro To Send Emails with PDF: Multiple Emails and PDF's
    By totoga12 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 03-19-2014, 06:13 PM
  3. [SOLVED] Creating emails from Excel using VBA
    By badlydrunkboy in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-19-2013, 11:04 AM
  4. Send outlook emails with message in cells to individual emails associated with them
    By abinayan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-21-2011, 06:11 AM
  5. looping through range of cells & sending multiple emails with outlook
    By splosczynski in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-03-2008, 01:49 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