+ Reply to Thread
Results 1 to 11 of 11

Help Programming Email Via Excel Spreadsheet

  1. #1
    Registered User
    Join Date
    09-08-2011
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    70

    Help Programming Email Via Excel Spreadsheet

    Hi all,

    I am trying to create a macro from a sheet formatted in the following way: (the sheet is a list of products we do not have in stock)

    Please Login or Register  to view this content.
    What I want to happen when I run the macro is an email is created/sent for each UNIQUE email address with a list of the parts that we have been unable to deliver to them.

    So for the example above, the email would read:

    Please Login or Register  to view this content.
    I have played around with the following, but am struggling with a way to tell excel to compile all shorts with the same email...

    Please Login or Register  to view this content.
    Any help with this would be appreciated.

    And also what code would include the default signature from my outlook?

    Thanks in advance

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,461

    Re: Help Programming Email Via Excel Spreadsheet

    I'd suggest that you sort and filter on the email address. Then you can send the visible cells using Ron de Bruin's approach ... http://www.rondebruin.nl/win/s1/outlook/bmail2.htm

    You can use an Advanced Filter to extract a list of unique email addresses and loop through that to Autofilter and send the data.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: Help Programming Email Via Excel Spreadsheet

    Or use Dictionary to create unique list and email.
    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  4. #4
    Registered User
    Join Date
    09-08-2011
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    70

    Re: Help Programming Email Via Excel Spreadsheet

    Hi,

    Thanks for the reply. I'm not sure the above would address my problem?

    To clarify, the spreadsheet would be 50 lines+, so to use the filter function would take too much time really.

    I'm really looking for one Macro that would do all emails if possible?

  5. #5
    Registered User
    Join Date
    09-08-2011
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    70

    Re: Help Programming Email Via Excel Spreadsheet

    Quote Originally Posted by bakerman2 View Post
    Or use Dictionary to create unique list and email.
    Please Login or Register  to view this content.
    I'm just playing with this one now.....

  6. #6
    Registered User
    Join Date
    09-08-2011
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    70

    Re: Help Programming Email Via Excel Spreadsheet

    Hi,

    No, I can't get that to work for me. My list may have 30 different emails on, with many of them repeated. I need the macro to create one mail per unique email address, but include the details from all rows associated with that email address...

    I apologise for my lack of coding knowledge....

  7. #7
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: Help Programming Email Via Excel Spreadsheet

    You can try out the attachment and let us know how this works for you.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    09-08-2011
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    70

    Re: Help Programming Email Via Excel Spreadsheet

    Hi Bakerman,

    The Macro runs, but no emails are generated?

    Am I doing something wrong here (been a loong day!)

  9. #9
    Registered User
    Join Date
    09-08-2011
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    70

    Re: Help Programming Email Via Excel Spreadsheet

    Sorry, to correct myself there...

    It's almost there. Just 2 small points.

    1. The macro creates the mails, but how do I get them to send rather than just create them.
    2. How would I go about adding my default signature to the emails?

    Many thanks for your patience!! It really is appreciated!

  10. #10
    Valued Forum Contributor meabrams's Avatar
    Join Date
    10-03-2014
    Location
    USA
    MS-Off Ver
    2007, 2010, 2013, 2016
    Posts
    451

    Re: Help Programming Email Via Excel Spreadsheet

    I can answer the first not sure how to get the sig to work.....

    find the line that has

    Please Login or Register  to view this content.
    and remove the .display ' and leave the .Send
    Bramz

  11. #11
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,461

    Re: Help Programming Email Via Excel Spreadsheet


+ 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: 2
    Last Post: 08-25-2014, 03:37 PM
  2. [SOLVED] Excel programming that sends an email to different recipients
    By joshnvince in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-26-2014, 05:40 PM
  3. Excel Automatic Email - VBA/ Macros/ Programming
    By workallday in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-08-2013, 07:55 PM
  4. Automatic email send
    By mmanalang in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-24-2012, 03:51 AM
  5. Excel code to email whats in the spreadsheet in the body of email
    By Kain93 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-18-2012, 09:55 AM
  6. excel spreadsheet to email
    By dougvcd in forum Excel General
    Replies: 1
    Last Post: 08-31-2009, 02:28 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