Excel - Error with Date Picker

Asked By Molly Turner on 30-May-12 02:04 PM
I created an userform in excel and placed a date picker on the form.
The date picker works fine and lets the user select the date, but
there is an issue when the information gets transferred to the
workbook.  The date appears as 05/30/2012 on the date picker but when
the data is  transferred to the worksheet it appears as 41059.  How
can I fix this??

M


Gord Dibben replied to Molly Turner on 30-May-12 02:52 PM
Format the receiving cell as Date mm/dd/yyyy

You can probably do that in the code behind your userform but we cannot
see that code.

Maybe...........

ActiveCell.Value = Format(Calendar1.Value, "mm/dd/yyyy")


Gord
Walter Briscoe replied to Molly Turner on 30-May-12 02:45 PM
In message <0ddb43d3-6ca8-4c31-86f5-e02e61248ff7@re8g2000pbc.googlegroup

Try formatting the cell to which the date is loaded as mm/dd/yyyy.

In Excel 2003, I entered 41059 in a cell.
41059 is 41058 days since Excel's minimum date - 01/01/1900.

I then put focus on that cell.
Ctrl+1 or Format/Cells opens a Format Cells dialog.
Select the Number tab and the Custom Category.
In Type:, in place of General, enter mm/dd/yyyy.
I have an issue in a British environment. the formula bar renders it as
dd/mm/yyyy - the default date format.

Adapt to your environment.

Where do you find a date picker? It is likely to be helpful to supply
more information for your next enquiry.
--
Walter Briscoe
Gord Dibben replied to Walter Briscoe on 30-May-12 03:39 PM
Walter

OP is most likely using the Excel default Activex Calendar Control


Gord