ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Date entry in userform help (https://www.excelbanter.com/excel-programming/279797-date-entry-userform-help.html)

bmwmcrider

Date entry in userform help
 
Hello,

I am trying to code a UserForm date entry technique using a TextBox
and a SpinButton but not having much luck at it. What I want to do is
have the date displayed in the text box as October 16, 2003. When I
hover over the month, it is hilighted and the spin button can be used
to select a new month. The same concept applies to the day and year
settings.

So my question is how is this done? I know that such a control exists
because is see done in Windows dialogs. In fact I have a couple apps
installed on my computer that popup dialogs and contain date setting
fields that do exactly as above.

I couldn't find anything on this subject in the couple Excel and VBA
books I have. Any help or suggestions would be appreciated. TIA ...

Mike

steve

Date entry in userform help
 
You might want to check this out...
In Excel 2000 and higher there is a Calendar control on the Control Toolbar.
This shows a full calander.

Right click on the Controls Toolbox
Click Additional Tools
Select Calendar Control

Play with the Properties to get what you want.

(I haven't worked with this, yet)

--
sb
"bmwmcrider" wrote in message
om...
Hello,

I am trying to code a UserForm date entry technique using a TextBox
and a SpinButton but not having much luck at it. What I want to do is
have the date displayed in the text box as October 16, 2003. When I
hover over the month, it is hilighted and the spin button can be used
to select a new month. The same concept applies to the day and year
settings.

So my question is how is this done? I know that such a control exists
because is see done in Windows dialogs. In fact I have a couple apps
installed on my computer that popup dialogs and contain date setting
fields that do exactly as above.

I couldn't find anything on this subject in the couple Excel and VBA
books I have. Any help or suggestions would be appreciated. TIA ...

Mike




bmwmcrider[_2_]

Date entry in userform help
 
Hi Steve,

Thanks for the reply. I am already familiar with the Calendar control;
there is also a MonthView control for entering a date.

However, both these controls take up a lot of space in the form. I am
trying to get a more compact control presentation for entering a date.
Thus, the TextBox control concept.

Mike




*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Tom Ogilvy

Date entry in userform help
 
You just put the code in the events of the spin buttons to increment the
value in the textbox. A special control for this function may exist, but
it is very straight forward using just a textbox and a spin button or three
textboxes and three spin buttons if you want to control month day and year
separately - you could have three spin buttons and a single textbox, but I
think that would be more confusing to the user.

If you want a sample workbook, send me an email with a valid email return
address.

--
Regards,
Tom Ogilvy



bmwmcrider wrote in message
...
Hi Steve,

Thanks for the reply. I am already familiar with the Calendar control;
there is also a MonthView control for entering a date.

However, both these controls take up a lot of space in the form. I am
trying to get a more compact control presentation for entering a date.
Thus, the TextBox control concept.

Mike




*** Sent via Developersdex
http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!





All times are GMT +1. The time now is 03:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com