+ Reply to Thread
Results 1 to 7 of 7

How can I get excel to automatically email 5 email addresses when an expiry date is due

  1. #1
    Registered User
    Join Date
    10-21-2014
    Location
    Sutton Valence
    MS-Off Ver
    2007
    Posts
    4

    How can I get excel to automatically email 5 email addresses when an expiry date is due

    I am working on a database that contains bus data, due dates for Mot's, Tax dates and disabled badges, I am trying to find out how I can get the spreadsheet to email 5 colleagues when the expiry date is due in 28 days? Can anyonel help please?

  2. #2
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: How can I get excel to automatically email 5 email addresses when an expiry date is du

    You'll need a reference to the Outlook Object Library (VBA Editor > tools > References)

    add the following in a module:
    Please Login or Register  to view this content.

    Then in your Workbook_Open event, add some code to compare the expiry dates (- 28 days) against todays date ( Now() ) and if less than today, pass the variables to the Function to send the email.

  3. #3
    Registered User
    Join Date
    10-21-2014
    Location
    Sutton Valence
    MS-Off Ver
    2007
    Posts
    4

    Re: How can I get excel to automatically email 5 email addresses when an expiry date is du

    Thanks unfortunately I am a touch niave regarding VB can you make this any simpler please?

  4. #4
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: How can I get excel to automatically email 5 email addresses when an expiry date is du

    without seeing your workbook and how the data is held etc its not possible to create the exact code you require. Below however is a very very basic sample code to do the same thing,

    In this case, column A has the vehicle registrations, B has the expiry dates and C is used to note when the emails have been sent (otherwise you'll continue to get mails every time).
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    10-21-2014
    Location
    Sutton Valence
    MS-Off Ver
    2007
    Posts
    4

    Re: How can I get excel to automatically email 5 email addresses when an expiry date is du

    Hi thanks again have tried unsuccessfully maybe you can help more if you can see the workbook, I have attached a copy. Would be very graterful for any help you could give.
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: How can I get excel to automatically email 5 email addresses when an expiry date is du

    Ive added the code for the MOT button, the logic and everything is the same just change references and columns where necessary when duplicating the code for other buttons.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    10-21-2014
    Location
    Sutton Valence
    MS-Off Ver
    2007
    Posts
    4

    Re: How can I get excel to automatically email 5 email addresses when an expiry date is du

    Hi thanks your help has ben invaluable!! One final thing, is there a line of code that will automatically send the email upon running the macro?

+ 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: 0
    Last Post: 06-28-2014, 09:31 AM
  2. Replies: 1
    Last Post: 09-09-2013, 03:46 PM
  3. Replies: 5
    Last Post: 02-22-2013, 02:00 AM
  4. Email from Excel to notify expiry date using Lotus Notes
    By ed.maldonado in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-26-2010, 05:40 PM
  5. 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

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