+ Reply to Thread
Results 1 to 5 of 5

Activex combobox date format

  1. #1
    Valued Forum Contributor
    Join Date
    03-17-2012
    Location
    Warsaw, Poland
    MS-Off Ver
    2007/2010
    Posts
    555

    Activex combobox date format

    hi all,

    attached a example of a combobox with a date. When the date gets chosen in the combobox it will no longer be displayed as a date but as a excel date serialnumber.

    As proof that I'm not a lazy bum, I've included a macro that is supposed to be working in this situation(googled it). In my case it still wont work :/

    Thanks !

    combobox example.xlsm

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Activex combobox date format

    Hi,

    Go to Properties and remove the number that's in the Value property field.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Valued Forum Contributor
    Join Date
    03-17-2012
    Location
    Warsaw, Poland
    MS-Off Ver
    2007/2010
    Posts
    555

    Re: Activex combobox date format

    Doesn't seem to do it :/

    Please Login or Register  to view this content.
    This code generates an error : "Run-time error '380':
    Could not set the Value property. Invalid property value."

    I guess that by getting rid of that error, the value would become a date. Anyone got a clue?

    Thanks!

  4. #4
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,060

    Re: Activex combobox date format

    try this
    Please Login or Register  to view this content.
    Regards, John55
    If you have issues with Code I've provided, I appreciate your feedback.
    In the event Code provided resolves your issue, please mark your Thread as SOLVED.
    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

    ...enjoy -funny parrots-

  5. #5
    Valued Forum Contributor
    Join Date
    03-17-2012
    Location
    Warsaw, Poland
    MS-Off Ver
    2007/2010
    Posts
    555

    Re: Activex combobox date format

    That didn't do it either john55. I googled it for quite some time and it turns out, that the problem lied within the style. It has to be fmStyleDropDownCombo instead DropDownList.

    With that out of the way, I've encountered another problem:

    Please Login or Register  to view this content.
    The Listindex function isn't returning anything but a 0 (regardless of the choice in the combobox). I noticed, that by ereasing the formating part from the code, the listindex works properly. Anyway i can bypass this limitation? I need the date being displayed (instead of a serial number) - at the same time i do need a listindex :/

+ 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