98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Userform
Userform
Resolved · High Priority · Version 2010
Lisa has attended:
Excel VBA Intro Intermediate course
Userform
Is it possible to have a text box in a userform that displays a calender pick box instead of allowing you to write text in? similar to a combobox but instead of a list - a calender is displayed?
Thanks,
Lisa
RE: userform
Hello Lisa,
Thank you for your question regarding calendar drop downs.
There are numerous ways to achieve what your require. I'll explain a simple method using Microsoft's own built in Calendar control.
If you are viewing your Userform in VB Editor, move your mouse over the Toolbox (the one with all the buttons on such as text box, checkboxes etc..) and right click. From the pop up menu select additional Controls. From the dialog box scroll through to find a conotrol called Microsoft Date and Time Picker, Select this and OK. You should see a new button on the toolbox. (If not, repeat again!).
Select this new tool and draw it on the Userform. When viewed you should see the calendar drop menu.
Obviously you'll need to code it to place the date somewhere!
I hope this resolves your question. If it has, please mark this question as resolved.
If you require further assistance, please reply to this post. Or perhaps you have another Microsoft Office question?
Have a great day.
Regards,
Mark
Microsoft Office Specialist Trainer
RE: userform
Thanks but this doesn't help as my toolbox doesn't have any additional controls when im in VB editor, so i can only use the microsoft calender if i was trying to put a date select box straight into excel.
to give a little more detail, the userform is for someone to enter financial transaction details and loads from a command button on the worksheet. I've used some vb to take the values entered in the text boxes on the userform and dump them in a tab full of transaction data. This works fine until it comes to dates. The main issue i get is that they seem to convert automatically to US dates, but i've now added some code to change them back to UK dates on upload.
I just thought it would be simpler and neater to have a date select thing. maybe i need to load some addins or something to get this toolbox command but i cant find any that work either.
Thanks
RE: userform
Hello Lisa,
As you are on 2010, you should find the Microsoft Data and Time additional control. Right Click the Floating Toolbox and select additional controls, scroll through all the list, past the Calendar control. The full title is Microsoft Date and Time Picker Control 6.0 (SP6).
If you still cannot find it, search the Microsoft website and there may be a download. However it does come with version 2010 so not sure why you cannot see it?
When/if you do use it you can you code like this:
Private Sub DTPicker1_Change()
Range("A1").Value = DTPicker1.Value
End Sub
I hope this resolves your question. If it has, please mark this question as resolved.
If you require further assistance, please reply to this post. Or perhaps you have another Microsoft Office question?
Have a great day.
Regards,
Mark
Microsoft Office Specialist Trainer
Sun 14 Aug 2011: Automatically marked as resolved.
Training information:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Excel tip:Adding multiple rows in an Excel 2010 WorksheetIf you want to add more than one row to an Excel Worksheet, drag select the number or rows you want added to the spreadsheet. |