+ Reply to Thread
Results 1 to 4 of 4

Why Won't The Date Display Correctly In A Userform Combobox?

  1. #1
    Forum Contributor
    Join Date
    08-04-2010
    Location
    Adelaide, Australia
    MS-Off Ver
    Office 365
    Posts
    176

    Why Won't The Date Display Correctly In A Userform Combobox?

    Hi all,

    this is a minor irritation more than a major problem but I'm flummoxed by it all the same. Rylo and ProtonLeah helped me with some code (thanks guys) for using a userform and spin button to amend data - the code is below
    Please Login or Register  to view this content.
    Here's the problem - the date in combobox2 won't display in the format I would like (DD-MMM-YY) - the data in Column B of the "Data" worksheets is just dates (formatted as DD-MMM-YY) - when the userform loads however, the date (eg 5 Jul 12) is displayed as 7/5/12

    I tried using a change
    Please Login or Register  to view this content.
    but this changes the displayed date to 7 May 12 and gives me a "Huh?" moment. What am I missing here?

    Cheers,

    AJ
    Last edited by ScotyB; 07-08-2012 at 06:31 PM. Reason: To mark as SOLVED
    Always grateful for the help here - thanks.

  2. #2
    Forum Contributor
    Join Date
    05-25-2012
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    194

    Re: Why Won't The Date Display Correctly In A Userform Combobox?

    I put together a userform, set cells(1, 1) = 5-July-12, and then used the following code;

    Please Login or Register  to view this content.
    The combobox displayed it fine to me... Try setting the format when you set the value, rather than via a trigger to the change combobox event.

    I also cleaned up your code a bit;

    Please Login or Register  to view this content.
    Last edited by Medpack; 07-05-2012 at 07:10 PM.

  3. #3
    Forum Contributor
    Join Date
    08-04-2010
    Location
    Adelaide, Australia
    MS-Off Ver
    Office 365
    Posts
    176

    Re: Why Won't The Date Display Correctly In A Userform Combobox?

    Medpack,

    that worked nicely, thank you.

    Cheers,

    AJ

  4. #4
    Forum Contributor
    Join Date
    05-25-2012
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    194

    Re: Why Won't The Date Display Correctly In A Userform Combobox?

    No problehm, happy to help.

+ 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