PDA

View Full Version : Excel Userform DatePicker Default Format to be Blank



vanhunk
02-19-2018, 06:02 AM
Before User select date, the date picker box must not show any date, i.e. format must be blank

The initial form must look like the one below.

21649

Once the date is selected with the drop down, the result must show normally, as below.

21651

I can initialise the form using a custom format of one space, but can't get it to change to normal when selecting a date from the drop down. It still shows it as blank.

I'm sure it can be done, but just can't get it to work.

Thank you for your time.

Regards
vanhunk

vanhunk
02-20-2018, 12:45 AM
The initial view can be achieved by different methods, either by code in in the initialisation step, or using the properties box, I could however not get it to change back when a date is selected/picked from the drop down.

Regards

gmayor
02-20-2018, 05:15 AM
The DatePicker control is no longer available in recent versions and while it can be made to work it is probably best avoided. I would suggest using a VBA date picker, and rather like Trevor Eyre's implementation which I have added to your workbook - along with the code to implement it. I have set the start date for each control as today's date (when clicked) and the initial setting is a blank text box.

vanhunk
02-20-2018, 06:54 AM
The DatePicker control is no longer available in recent versions and while it can be made to work it is probably best avoided. I would suggest using a VBA date picker, and rather like Trevor Eyre's implementation which I have added to your workbook - along with the code to implement it. I have set the start date for each control as today's date (when clicked) and the initial setting is a blank text box.

Thank you so much gmayor, this is perfect and exactly what I was looking for. :thumb