+ Reply to Thread
Results 1 to 13 of 13

Dateformat in a combobox

  1. #1
    Registered User
    Join Date
    11-16-2016
    Location
    Sweden
    MS-Off Ver
    2016
    Posts
    35

    Dateformat in a combobox

    Hello,

    I have a combobox, see Picture. How do I change the format so the combobox will display the format on the top row?

    Cheers Raffe

    DateCombobox.jpg

  2. #2
    Valued Forum Contributor PFDave's Avatar
    Join Date
    05-17-2012
    Location
    Milton Keynes, England
    MS-Off Ver
    Excel 2013
    Posts
    1,067

    Re: Dateformat in a combobox

    How are you assigning the listfillrange? is this using name manager because the combobox should match the formatting of that range

  3. #3
    Registered User
    Join Date
    11-16-2016
    Location
    Sweden
    MS-Off Ver
    2016
    Posts
    35

    Re: Dateformat in a combobox

    Hello Dave, I fill it like this. Can I change the format in the combobox in some way?

    Cheers Raffe

    With ThisWorkbook.Sheets("Main").TimeFrom
    .Clear
    .Value = ""
    .List = ThisWorkbook.Worksheets("Data").Range(DataCombo).Value
    .SelText = ThisWorkbook.Sheets("Data").Range("A2")
    End With

  4. #4
    Valued Forum Contributor PFDave's Avatar
    Join Date
    05-17-2012
    Location
    Milton Keynes, England
    MS-Off Ver
    Excel 2013
    Posts
    1,067

    Re: Dateformat in a combobox

    Is your range DataCombo formatted as you have asked for in your OP?

  5. #5
    Registered User
    Join Date
    11-16-2016
    Location
    Sweden
    MS-Off Ver
    2016
    Posts
    35

    Re: Dateformat in a combobox

    Yes, it is format as:

    電電-MM-DD tt:mm:ss,0

    So why does the combobox show date with PM?

  6. #6
    Valued Forum Contributor PFDave's Avatar
    Join Date
    05-17-2012
    Location
    Milton Keynes, England
    MS-Off Ver
    Excel 2013
    Posts
    1,067

    Re: Dateformat in a combobox

    try format as

    電電-MM-DD tt:mm:ss

  7. #7
    Registered User
    Join Date
    11-16-2016
    Location
    Sweden
    MS-Off Ver
    2016
    Posts
    35

    Re: Dateformat in a combobox

    But I would like to have the resolution ms.

  8. #8
    Valued Forum Contributor PFDave's Avatar
    Join Date
    05-17-2012
    Location
    Milton Keynes, England
    MS-Off Ver
    Excel 2013
    Posts
    1,067

    Re: Dateformat in a combobox

    Hrmm, you might be able to use a private sub for combobox change event to format but not sure why you'd need to do it there as well.

  9. #9
    Registered User
    Join Date
    11-16-2016
    Location
    Sweden
    MS-Off Ver
    2016
    Posts
    35

    Re: Dateformat in a combobox

    How do I do that?

  10. #10
    Valued Forum Contributor PFDave's Avatar
    Join Date
    05-17-2012
    Location
    Milton Keynes, England
    MS-Off Ver
    Excel 2013
    Posts
    1,067

    Re: Dateformat in a combobox

    Please Login or Register  to view this content.

  11. #11
    Valued Forum Contributor PFDave's Avatar
    Join Date
    05-17-2012
    Location
    Milton Keynes, England
    MS-Off Ver
    Excel 2013
    Posts
    1,067

    Re: Dateformat in a combobox

    or if that fails try:

    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    11-16-2016
    Location
    Sweden
    MS-Off Ver
    2016
    Posts
    35

    Re: Dateformat in a combobox

    It did not work. I use the Active-x Control, does it matter?

  13. #13
    Valued Forum Contributor PFDave's Avatar
    Join Date
    05-17-2012
    Location
    Milton Keynes, England
    MS-Off Ver
    Excel 2013
    Posts
    1,067

    Re: Dateformat in a combobox

    Can you use form control?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 7
    Last Post: 02-01-2016, 01:55 PM
  2. listbox changes dateformat
    By stewart1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-02-2015, 11:47 AM
  3. VBA DateFormat
    By jagadeesh.rt in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-29-2014, 02:48 AM
  4. Stop Excel from converting numbers to Dateformat
    By ChrisNor in forum Excel General
    Replies: 13
    Last Post: 11-12-2011, 04:16 AM
  5. Problem with dateformat when copied from userform
    By age in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-30-2007, 02:02 PM
  6. [SOLVED] VBA Excel Chart DateFormat Language Settings Locale
    By Marabu in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-09-2006, 07:20 AM
  7. [SOLVED] Dateformat
    By Kjeldc in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-13-2005, 05:06 PM

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