Date Picker Calendar in Excel VBA
Oftentimes, users want to click a button and select a date. This is no different for Excel developers. Check out this ActiveX control by Microsoft that allows users to do just that. It's a little old school looking, but actually has quite a nice feel to it.
Start by creating a userform and enabling the control by Right-clicking on the Tools menu and click Add additional tools
Now, let's add this to the userform!
In the downloadable workbook, you'll see the control was renamed to 'fCal'. When you double-click the control you'll see the following code which is the DateClick event of that control:
code snippet
This userform cleverly has two labels to store relevant info on the Userform that summoned it. 1.) The name of the userform that called it and 2.) The name of the control or textbox that needs the date sent to it.
Then, this code above loops through all userforms in your project until it finds one that matches the label for the Userform (lblUF) and the label for the textbox needed (lblCtrlName).
Also, you may need to enable Microsoft Windows Common Controls -2 6.0 (SP6) by using Tools->References and clicking:
s
Stop Wasting Your Time
Experience Ultimate Excel Automation & Learn to "Make Excel Do Your Work For You"
s
Wow cuz this is really excellent job! Congrats and keep it up.
Thanks, Brian!
HELLO, Your work is very beautiful
Thanks, adam, much appreciated!
I do not have this function IN OFFECE 2013 64 BIT!
Is there a solution to this problem?
Hi Adam,
The datepicker and monthview controls are for 32bit only, unfortunately. I am working on a version agnostic tool and how to use it. I'll keep you posted.
Thanks
Dan