Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel Format Problem - Date Overrides Format | Excel Discussion (Misc queries) | |||
Format Date ComboBox | Excel Discussion (Misc queries) | |||
Date Format Problem | Excel Programming | |||
Userform: Combobox, dates, match required- can't get date format to work | Excel Programming | |||
ComboBox Format Problem | Excel Programming |