Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Combobox/Rowsource - loses date/time format


Hi there,

Hopefully a simple one. On a userform I have developed there are
several comboboxes that use data on a worksheet as the rowsource.

This data is in either date/time format.

The list populates in the combo in date/time format, but once a value
is selected, the value displayed is the actual number that corresponds
with the selection, not the date itself (i.e. it loses the date/time
formatting).

i.e. user will 20/08/2006 when making a selection from the combo, once
selected the user will see 38949.

Does anyone know how to stop this occurring so that the date/time is
always visible?

Thank you

Rob


--
systemx
------------------------------------------------------------------------
systemx's Profile: http://www.excelforum.com/member.php...o&userid=29254
View this thread: http://www.excelforum.com/showthread...hreadid=566529

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Combobox/Rowsource - loses date/time format

Hi Rob,

Try something like:

'=============
Private Sub ComboBox1_Change()
With Me.ComboBox1
.Value = Format(.Value, "dd/mm/yy h:mm")
End With
End Sub
'<<=============


---
Regards,
Norman


"systemx" wrote in
message ...

Hi there,

Hopefully a simple one. On a userform I have developed there are
several comboboxes that use data on a worksheet as the rowsource.

This data is in either date/time format.

The list populates in the combo in date/time format, but once a value
is selected, the value displayed is the actual number that corresponds
with the selection, not the date itself (i.e. it loses the date/time
formatting).

i.e. user will 20/08/2006 when making a selection from the combo, once
selected the user will see 38949.

Does anyone know how to stop this occurring so that the date/time is
always visible?

Thank you

Rob


--
systemx
------------------------------------------------------------------------
systemx's Profile:
http://www.excelforum.com/member.php...o&userid=29254
View this thread: http://www.excelforum.com/showthread...hreadid=566529



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Combobox/Rowsource - loses date/time format


Hi Norman,

Thank you for the help mate. It worked perfectly. The other method tha
worked for me was to setup the source data as 'text', then format i
after it was spat back out of the userform.

Cheers

Ro

--
system
-----------------------------------------------------------------------
systemx's Profile: http://www.excelforum.com/member.php...fo&userid=2925
View this thread: http://www.excelforum.com/showthread.php?threadid=56652

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
RowSource for Sheet ComboBox Minitman Excel Worksheet Functions 3 March 24th 08 09:43 PM
Combobox rowsource Marinos Andreou Excel Programming 2 March 7th 06 05:08 PM
How can Rowsource be used for a combobox on a form? Matt[_33_] Excel Programming 5 October 25th 05 03:00 AM
How Do I Load A ComboBox RowSource From The Results Of Another ComboBox Minitman[_4_] Excel Programming 3 October 26th 04 07:58 PM
combobox rowsource Newbie Excel Programming 1 September 8th 04 12:21 PM


All times are GMT +1. The time now is 12:22 AM.

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"