ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Format a Userform Textbox Properties (https://www.excelbanter.com/excel-programming/399569-format-userform-textbox-properties.html)

JoJoB

Format a Userform Textbox Properties
 
How do I set the properties of a textbox in a suerform to accept a date only?

Rick Rothstein \(MVP - VB\)

Format a Userform Textbox Properties
 
How do I set the properties of a textbox in a suerform to
accept a date only?


Instead of using a TextBox, why not consider using a Microsoft Date and Time
Picker control. It is a combo box like control with a text area pre-filled
in with a date whose month, day and year fields can be visited and changed
via the arrow keys or by typing in value for each of them. In addition,
clicking the down arrow pops up a calendar's month view where your user can
pick the date from.

To add one to your UserForm's Toolbox, right click a blank area of the
UserForm's Toolbox and select "Additional Controls" from the popup menu that
appears. Scroll down until you find an item that says "Microsoft Date and
Time Picker Control" and place a checkmark next to it; then hit OK. Now,
select the DTPicker (what the control is called in its ToolTip) control that
was added to the Toolbox and place it on the UserForm. The size of the month
display is controlled by the Font Size used.

Rick



All times are GMT +1. The time now is 01:46 PM.

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