Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel Format Problem - Date Overrides Format Mary Excel Discussion (Misc queries) 5 February 10th 10 05:49 AM
Format Date ComboBox Blobbies Excel Discussion (Misc queries) 4 January 10th 08 08:40 AM
Date Format Problem Mario Excel Programming 5 February 9th 05 03:35 PM
Userform: Combobox, dates, match required- can't get date format to work KR Excel Programming 2 November 10th 04 05:18 PM
ComboBox Format Problem CG Rosén Excel Programming 1 June 22nd 04 02:26 AM


All times are GMT +1. The time now is 05:29 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"