So you want to create a drop down calendar in Excel? Apart from sending alerts to Outlook from Excel (working on that article as well) this has been the most requested how-to as of late. For example:
Reader Tim Asks:
How do I insert a calendar as a way for a user to click on the cell have the date box open and choose the date that should be in the cell? Also where do I send the beer?
Reader Wayne Asked:
I am sure that I saw a pull down menu in a worksheet cell. I want to have a cell formated so that I can have a pull down menu of a calendar in which to choose the date.
This seems like it would be so easy yet when you look around on-line the answers are all full of VBA scripts and custom code.
I assume you just want someone using the spreadsheet to be able to select a cell, have a calendar drop down and then populate the field with whatever date the person chooses. Yes it can be done. Yes it is fairly involved. And yes, I have a workaround.
Would you like the easiest, cheesiest, sleaziest way to do this? Well then watch this:
The first thing you need to do is enable the Developer Tab in Excel.
Now you have the developer tab with all the controls for forms, xml, code, etc.
Go to the developer tab and select Insert, followed by the little Pink Floyd-esque More Controls icon.
Scroll through the list of controls and look what’s available. There are all sorts of funky add-ins you can use in your spreadsheets! We are looking for the Microsoft Date and Time Picker Control
Highlight it and select OK.
Your mouse will turn in to a cross hair – click and hold, draw a rectangle, release. You now have a date box!
You will also see code in the top akin to “=EMBED(“MSComCtl2.DTPicker.2″,””)”
You will also notice that you are in Design Mode because that icon is highlighted. This allows you to play with the settings for the date box you just created.
Deselect Design Mode and you have a date control! Select the drop down and a calendar appears! Holy Cow that’s super cool awesome but guess what! It doesn’t do anything!
You can click it and change the date as much as you want but nothing else is changing in your spreadsheet!
Here is where the genius of my non-code writing laziness pays off. Ready?
What cell do you want the date to change in? Let’s say C5
Here’s where it all comes together. .
Last Question: How do I use this?
Well you can create as many of these drop downs as you like. You can tell each one what cell to update (Linked Cell) and you can move the Date Control right over the top of the field it is updating! Think about that – Move the date picker right over the top of the cell it is linked to. Only you know the truth! There is no advanced code, you’re just hiding the data in C5 under the Date control that is updating or controlling C5! Then do any date calculations you need to do using C5 as the reference!
I told you it was sleazy, cheesy and easy!
I’ll make it even easier – here’s the spreadsheet I used to write this tutorial and take screen shots
And Tim, You any any other reader can always send the beer to me by clicking beer mug at the top of the page.