PDA

View Full Version : date pick error



ashgull80
09-03-2016, 10:13 AM
hi

im using the microsoft date pick drop down box but its causing a few errors.
every time i select the box it shows a second box in the top left corner?
also it wont let me have multiple date select combo boxes.
is there a reason for this or a better option?

thanks ash

Kenneth Hobs
09-03-2016, 03:10 PM
Without code or an example workbook, I don't see how we can help. ActiveX datetime controls can be problematic.

ashgull80
09-04-2016, 04:35 AM
hi thanks for your reply.
my apologies, all ive done so far is added the "microsoft date and time picker control 6.0 (SP4)" but it seems to resize its self and then i cant add a second one to the same page.
is there a better option you could suggest that means i can select a date from a calendar?
thanks ash

Kenneth Hobs
09-04-2016, 09:02 AM
This userform method is more reliable.

ashgull80
09-04-2016, 01:51 PM
hi that is great thank you very much, is it alot of work to change the date format to dd-mmm-yy
thanks ash

Kenneth Hobs
09-04-2016, 04:40 PM
No.

Normally, one would set the format manually.

If you want to set it for the user and you are using the Sheet Selection event, I would recommend adding an Intersect() so that it fires for just a set range. You can then just set NumberFormat() once.

Otherwise, if you really want to force it in the Userform code, you will have to modify it in each day button's Click event. That code could be made more efficient though. In any case, to do that the kludgy way, then here is the first one:

Private Sub D1_Click()
ActiveCell.Value = D2.ControlTipText

ActiveCell.NumberFormat = "dd-mmm-yy"

Unload Me
End Sub