Link to home
Start Free TrialLog in
Avatar of bjfulkerson
bjfulkerson

asked on

How do I add a date picker to a text box in a userform in Excel 2007

How do I add a date picker to a text box in a  userform in Excel 2007
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

What do you mean when you say "add a date picker to a text box"? Do you mean that you want the result of the selection in a date picker to appear in a textbox?
Avatar of bjfulkerson
bjfulkerson

ASKER

I want to be able to pick a date from a calendar and populate a text box with that date.
Here's a few links explaining how to place an ActiveX date picker control into an Excel 2007 worksheet ...

http://www.fontstuff.com/excel/exltut03.htm
http://www.rondebruin.nl/win/s8/win003.htm
Can this be done in a userForm
Can this be done in a userForm
The second link above says ...
How to Create a userform with a calendar or Date Picker control on it
So it must be possible.

You could also try this free addon ...
http://www.excel-it.com/excel_datepickers.html
ASKER CERTIFIED SOLUTION
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I am on Excel 2007, and I do not see that option.
I'm not sure which "option" you mean, so please explain. But here is a demo workbook that shows the results of the above steps.
Q-28582649.xls
I got it to work.  

Private Sub Calendar1_Click()
TxtDate.Text = Calendar1.Value
End Sub
I suggest you use the Change event instead.

Private Sub Calendar1_Change()
TxtDate.Text = Calendar1.Value
End Sub

Open in new window


But in any case I'm glad I was able to help.

In my profile you'll find links to some articles I've written that may interest you.
Marty - MVP 2009 to 2014
Thanks