+ Reply to Thread
Results 1 to 10 of 10

Contracts Expiry Email Via Excel

  1. #1
    Registered User
    Join Date
    02-17-2020
    Location
    UAE, AD
    MS-Off Ver
    Office 14
    Posts
    5

    Exclamation Contracts Expiry Email Via Excel

    Hello Everyone,

    I hope that all are well.

    Anyway, I have an excel sheet similar to the one attached that has a list of contracts and their expiry dates.
    I would like for excel to send me an email as a reminder that a contract is expiring within 2 months.
    Please note that the excel sheet attached is exactly like the one I am using except the content is different.
    Furthermore, I use outlook for emails if that matters.

    Thank you in advance!
    Hope you have a nice day.
    Attached Files Attached Files

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Contracts Expiry Email Via Excel

    What information do you want included in the email? Just the contract name & expiry date
    Do you want a single email that contains all the contracts due to expire.

    Your request implies others are completing the workbook, or else surely you could just add an extra column that identifies a contract will be expiring in <2 months and filter on that column.
    So what event should trigger that macro? Perhaps a 'Before_Save' or a 'Before_Close' event?
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    02-17-2020
    Location
    UAE, AD
    MS-Off Ver
    Office 14
    Posts
    5

    Re: Contracts Expiry Email Via Excel

    Quote Originally Posted by Richard Buttrey View Post
    What information do you want included in the email? Just the contract name & expiry date
    Do you want a single email that contains all the contracts due to expire.

    Your request implies others are completing the workbook, or else surely you could just add an extra column that identifies a contract will be expiring in <2 months and filter on that column.
    So what event should trigger that macro? Perhaps a 'Before_Save' or a 'Before_Close' event?

    Information to be included in the email: Number, Supplier and expiry date.
    Soon to expire contracts to be sent in a single email.

    Other will also have access to this workbook not just me.

    Regarding the triggering, I am not really sure what either means, can you please clarify? Thank you!

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Contracts Expiry Email Via Excel

    What event should start the process of producing the email and sending to you.

    ARe you expecting someone to manually click a button or should this be automatic when someone chooses to save or close the workbook. Bear in mind with the save event you would get an email evey time someone saved the current workbook after adding stuff and then continued to add more data & save again.....etc.

  5. #5
    Registered User
    Join Date
    02-17-2020
    Location
    UAE, AD
    MS-Off Ver
    Office 14
    Posts
    5

    Re: Contracts Expiry Email Via Excel

    I would prefer it to be a button.

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Contracts Expiry Email Via Excel

    What about an expiry date that is prior to the current date e.g. 31/3/2019 in H11. Should that be reported?

    Other than that none of the other expiry dates are less than two months away so it appears this is bad test example.
    However please confirm that as it is currently presented you wouldn't expect to receive an email. I'll change some of the dates for testing purposes.

  7. #7
    Registered User
    Join Date
    02-17-2020
    Location
    UAE, AD
    MS-Off Ver
    Office 14
    Posts
    5

    Re: Contracts Expiry Email Via Excel

    Right, just noticed that the dates provided are not ideal for this sorry for that.
    Please change the dates as you see fit.
    Is it possible to have excel send a list for all expired contracts at the time and another for soon to expire?
    I mean like 2 buttons one would be for expired and the other would be for soon to expire.
    Furthermore, lets say later I add an additional column after the supplier column would that affect the work you are preparing?

  8. #8
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Contracts Expiry Email Via Excel

    For clarification purposes are you defining Expired contracts as any contract with a date in column H that predates the Current Date.

    That was the behind my question in post #6

    RE your question about adding an additional column after supplier. As I've previously written the macro then yes that would have an effect since it shifts the Expiry date column across. That's not a problem now you've mentioned it so I have catered for this in the code below

    It then depends whether any additional column you add contains information that you want to report in an eMail. If so that's more problematic, particularly if there were any conditions attached to whether to report it or not. For now you should work on the assumption that the code would need modifying if you needed to report the information from any additional column in the email.

    If you know now what you might want to add as an extra column then it might be preferable to add it now for use later and hide the column if necessary. And in addition say whether in due course when you start to use that column whether you want the information included in the Email.

    Just a thought. Rather than two buttons to run either the forthcoming expiry dates or already expired contracts, why not include both in a single email. The first part of the email could be all the forthcoming expiry dates and these would be followed by the Expired Contracts

    The attached workbook contains the following macros.
    It also contains a range name for the current column H. This will adjust should you add an extra column prior to column H and the macro will continue to run.

    Edit your email address where I show the .TO line of code highlighted in red

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

  9. #9
    Registered User
    Join Date
    02-17-2020
    Location
    UAE, AD
    MS-Off Ver
    Office 14
    Posts
    5

    Re: Contracts Expiry Email Via Excel

    "For clarification purposes are you defining Expired contracts as any contract with a date in column H that predates the Current Date."

    Yes.

    A column might be added after the supplier column named Description. At this moment I am not sure whether I need to add it in the email.
    I tried the email expired contracts button and it works just fine however, the other button once clicked a small window pops up saying "Run time error 1004, unable to get the EDate property of the worksheetFunction class".

    Also, is there a way to fix the way information is displayed in the email so that it is not jumbled up?

    Thanks again for the great help and quick responses.

  10. #10
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Contracts Expiry Email Via Excel

    Hi,

    Re the EDate function.
    Are you using the workbook I sent you or have you copied the macros I sent into another workbook?

    If so did you remember to add the Range name that I mentioned in post #8.

    i..e the range name "ExpColumn" which refers to $H$8

    Does the data start on row 9? If not adjust the x loop counter which starts at 9 in the line of code to whatever is the first row of data.

    [FORMULA]For x = 9 To lRow[/FORMULA.

    If neither of the above fix the problem plese upload the workbook you are using,

+ 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: 1
    Last Post: 01-03-2019, 08:38 AM
  2. Send email from Excel based on expiry date approaching
    By kordon in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 05-19-2015, 11:55 PM
  3. Replies: 6
    Last Post: 11-06-2014, 06:12 AM
  4. Excel macro to send email through outlook when expiry nearing
    By bqheng in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-17-2014, 08:07 PM
  5. Replies: 5
    Last Post: 02-22-2013, 02:00 AM
  6. excel code that will send mail to 2 email ID before 30 days of visa date expiry
    By rinadimayuga in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-27-2012, 04:24 AM
  7. 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

Tags for this Thread

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