+ Reply to Thread
Results 1 to 3 of 3

Combobox/Rowsource - loses date/time format

  1. #1
    Registered User
    Join Date
    12-01-2005
    Posts
    45

    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

  2. #2
    Norman Jones
    Guest

    Re: 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" <[email protected]> wrote in
    message news:[email protected]...
    >
    > 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. #3
    Registered User
    Join Date
    12-01-2005
    Posts
    45
    Hi Norman,

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

    Cheers

    Rob

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1