troubleshooting Question

Excel VBA - UserForm Textbox Date Validation

Avatar of sergeiweerasuriya
sergeiweerasuriya asked on
Programming
5 Comments1 Solution13837 ViewsLast Modified:
I need to check whether the Date a user inputs into a textbox is a valid date format. When i initially run the form todays date should appear in the textbox. I managed to do that with the following code:
txtDate.value = Format((Date), "dd/mm/yy")

The required Date Format is "dd/mm/yy".

Next, the user should be able to change this date accordingly. Now the user should be able to change the day,month,and the year. For instance the user should not be able to input a date where the 'Day' part is larger than 31 and the 'Month' part is larger than 12. Before i transfer this date to the spreadsheet i need to check whether the Date user has input is a valid date or not.
ASKER CERTIFIED SOLUTION
consulteware

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros