How many times have I been asked this – let me count the ways . . .
How can I set up an excel document with suspense dates and get alerts from Outlook to remind me when they are due?
I built an Excel project management spreadsheet that uses start and end dates to track tasks. One field shows remaining days to complete the task. My question, is there a way to have excel utilize my Outlook to send me an email once a task is within 3 days of completion or past due? (I do not have the funds to license all my staff with Microsoft Project)
And a dozen more in the comments of various articles. Here’s the deal gang, while this sounds like an excellent idea – automatic Outlook reminders from an Excel spreadsheet – its not.
If you approach this with VBA code that says “Send an email to Outlook when . . .” that “When” statement has the potential to really screw some things up. First off, the spreadsheet needs to be open for the code to run. What happens when you go on vacation for two weeks and come back and open the file? What if you just forget to open the actual file because you are relying on an automatic reminder? How many pop-up meail windows are you going to get? How do you know everyone was emailed that needed to be emailed?
This is a case where automation sounds fantastic but in my opinion its really not a good idea.
Soapbox aside . . . Of course I have figured out an alternative for you.
I think the original script for this came from Martin Green over at FontStuff.com, or I found it in a discussion board. Disclaimer: I have modified the script to bend it to my will but I want to give props to whoever wrote the original core script. OK, props given – lets solve this mystery!
Do you want Excel to alert you of an approaching due date? Do you want to be able to send an automatic email to a person related to an item in that spreadsheet? Try it this way:
1. Download this file: Outlook eMail from Excel. (17k zip)
It is the example we will work from. I am going to show you a few tricks and then leave you to your own devices. Copy the pieces that work for your unique situation, ignore the ones you don’t need.
2. We are going to be working in developer mode so make sure you know how to enable it in Excel. The directions are in this posting.
3. Open up the spreadsheet you downloaded and follow along… Oh, and the spreadsheet has a Macro in it that you have to enable. Its safe, Trust me. I used to work for the Government.
So what are we looking at?
These columns can be rearranged anyway you see fit for your unique project. In this example we have people’s names, an email subject, an imaginary due date, an “email sent?” column, the person’s email address and a custom body message.
Click on any cell in a row to select it and then click the SEND MAIL button at the top of the spreadsheet. I’ll choose row 6, “Bill Jones”, the email generated looks like this:
What happened? The email address was filled, the subject line of the email was filled in and the custom body message was put in the body between two other lines of text.
Light-bulbs going off yet?
Where did those other lines of text in the body come from? A Macro. Let’s take a look at that macro so you can customize it.
Choose the DEVELOPER tab in Excel and click Macros (Again, the directions for enabling the Developer tab are in this posting.)
With the Macro box open select SendEmail and Edit.
Here is the code that does the magic.
There are 3 lines of code you need to be aware of so you can modify them if need be:
Line 1 says “Get the email address from Row 10 of the active cell.” This is a little misleading, its actually column 10 or “J”.
Line 2? Get the email subject from row (column) 4 or “D”
And Line 3? Prints “Dear” and whatever in is column 1 or “A”, and then the precanned text before and after whatever in in the spreadsheet in column 13 or “M”.
If you change around the columns in your spreadsheet, simply change the numbers to correspond to the data’s new location! You can even add more information in the email from your spreadsheet – the magic term is “Cells(ActiveCell.Row, ????)”
Not too bad! Not too complicated either.
Now lets take a look at the date information back in the spreadsheet:
In the top right hand corner of the spreadsheet is Today’s Date, Excel formula being “=TODAY()”
The dates in column “F” are “Due Dates” I entered in manually. Maybe your spreadsheet will calculate these cells from other data you have. The color change is based on a “Rule” that is comparing the date we entered to today’s date. You could just as easily give yourself a heads-up by referencing a date in the future instead of today’s date “=Today () +7″, etc.
Back to the rule:
And there is the rule that says “Blank Cells are just white” and “If the value of this cell (the date of this cell) is less than or equal to Today’s Date in R1 – color me reddish.”
You know have a visual flag that the item is due or past due and action needs to be taken! Again, change this to whatever suits your need! Make it red, make it green – your choice!
The red X in the sent column is just another “food for thought” column. A reminder to yourself that you actually acted on the due or overdue item. So let’s look at this from the beginning on a typical work day:
That’s pretty labor unintensive! Seriously? 3 Steps
I am looking forward to see how all of you will improve upon this simple concept. This has been a hot topic in the comments section. There is no one size fits all solution but I hope that by taking this simplistic approach I save a lot of people a lot of time.
It doesn’t have to be complicated, and you don’t need to be a programmer!