ComboBox Date Format Problem
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 |
ComboBox Date Format Problem
Try
Private Sub ComboBox1_Change() ComboBox1.Value = Format(ComboBox1.Text, "dd/mmm/yyyy") End Sub "CiaraG" wrote: 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 |
ComboBox Date Format Problem
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. "Toppers" wrote: Try Private Sub ComboBox1_Change() ComboBox1.Value = Format(ComboBox1.Text, "dd/mmm/yyyy") End Sub "CiaraG" wrote: 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 |
All times are GMT +1. The time now is 09:17 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com