+ Reply to Thread
Results 1 to 4 of 4

Problems with date format

  1. #1
    Registered User
    Join Date
    05-07-2012
    Location
    Denmark
    MS-Off Ver
    Excel 2007
    Posts
    42

    Problems with date format

    Hi

    I have an userform with a calendar on it, so the user can choose the prefered data. This is saved as a string in the format "mm/dd/yyyy". I would like to save it as a date and with the format "dd/mm/yyyy" instead, but I cannot figure out how. I have tried this:

    Please Login or Register  to view this content.
    Last edited by h0ps; 12-04-2012 at 09:51 AM. Reason: solved

  2. #2
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Problems with date format

    Maybe try

    Format(CDate(DateTB.Value), "mm-dd-yyyy") see if that works.

  3. #3
    Registered User
    Join Date
    05-07-2012
    Location
    Denmark
    MS-Off Ver
    Excel 2007
    Posts
    42

    Re: Problems with date format

    This does the job for 12-28-2012 => 28-12-2012. But for instance 12-07-2012 is kept as 12-07-2012.

  4. #4
    Registered User
    Join Date
    05-07-2012
    Location
    Denmark
    MS-Off Ver
    Excel 2007
    Posts
    42

    Re: Problems with date format

    Ah I changed the wrong part of the code. Your suggestion solved the problem. Thanks alot!

+ 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