ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   dates in a combo box (https://www.excelbanter.com/excel-programming/274635-re-dates-combo-box.html)

Tom Ogilvy

dates in a combo box
 
Actually, that is the date serial number. This is how dates are stored.

The easiest approach in my opinion is to load the box with strings rather
than dates.

Private Sub Userform_Initialize()
Dim rng as Range, Dim cell as Range
set rng =Worksheets("Sheet1").Range("A1:A10")
for each cell in rng
useform1.combobox1.AddItem rng.Text
Next
End sub


--
Regards,
Tom Ogilvy



"Kevin Smith" wrote in message
...
Hi,

Hopefully a quick one. I have a combo box and the contents
of the list within the combo box are dates. When a date is
selected however, in the combo box, the result is in the
1900 date format (is that right). e.g. September 1st 2003
reads 37865. I have had a look in the combo box properties
but no avail. Is there a way that 1st September 2003 can
read 1st September 2003 when it is selected?

Cheers

Kevin





All times are GMT +1. The time now is 01:47 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com