ComboBox Date Format Problem

G

Guest

I have a combobox on a userform that is linked via the row source property to
a list of dates on Worksheet A. The dates are formatted as dd/mmm/yyyy on
the worksheet and are displayed as such within the combobox. However when
the user selects a date from the list it is displayed in the combobox in a
general format i.e. "36125". My userform is set up that when the user makes
a selection that it writes the contents to WorksheetB, the date is displayed
correctly as dd/mmm/yyyy when written to the worksheet.

Does anyone know how I may change the combobox so that the date is displayed
correctly when selected and in such a way that the format does not change
when written to the underlying worksheet??

All ideas welcomed!

Thanks,

Ciara
 
G

Guest

Try

Private Sub ComboBox1_Change()
ComboBox1.Value = Format(ComboBox1.Text, "dd/mmm/yyyy")
End Sub
 
G

Guest

Thanks you so much. I have been thrawling through the internet for days now
and have tried variations of the code below but with no luck. Thank you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top