Formatting Textboxes in User Form to Show Date & Time
Posted on 2011-04-25
I have a spreadsheet which contains a userform.
The purpose of the userform is two-fold.
1) It can be used to input data into the spreadsheet.
2) It can be used to recall rows of data from the spreadsheet.
Some of the textboxes are used for entering a date and time. This info is then transposed onto the worksheet where I have cells formatted to display dd/mm/yyyy and dd/mm/yyyy hh:mm and hh:mm:ss. Hpwever, when I use the form to recall the data, instead of displaying the text in the format shown above, in the textboxes it displays the text in a decimal format! eg instead of showing the time as 13:45:00 it shows 0.5729166666667!
Can the textboxes of the userform be formatted to display certain types of text, i.e. Date, Date & Time, Time, Numbers Only, etc
Also in the first instance of the userform, can the textboxes be formatted to only accept certain types of data? i.e. Numbers 7 characters long or N/A if the user leaves them empty?