+ Reply to Thread
Results 1 to 4 of 4

CDate fails to convert when system in different locale

  1. #1
    Forum Contributor
    Join Date
    09-30-2009
    Location
    Barcelona
    MS-Off Ver
    Excel 2010
    Posts
    274

    Arrow CDate fails to convert when system in different locale

    I've done some research and I have not found any solution so I am positing it here to see if it is REALLY impossible before I give up

    I have a macro that reads some cells coming in a "dd mmm yyyy" format as a string, where mmm are the three-letter abreviation in ENGLISH. To read it I replace spaces as hyphons and use CDate. No problem here, since I set my system with english formats.

    however when run from a spanish locale computer Cdate fails to convert it to date.

    is there any function that can do the trick?

    the macro involves numerous date comparisons, so better if it is something simple


    thanks!
    Last edited by bagullo; 11-10-2010 at 10:20 AM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: CDate fails to convert when system in different locale

    If the inputs are always English/American then you should find you can use Evaluate

    Please Login or Register  to view this content.
    the above would work on both UK & Spanish Locale

  3. #3
    Forum Contributor
    Join Date
    09-30-2009
    Location
    Barcelona
    MS-Off Ver
    Excel 2010
    Posts
    274

    Re: CDate fails to convert when system in different locale

    works like a charm, THANK YOU!
    Last edited by DonkeyOte; 11-10-2010 at 11:56 AM. Reason: removed unnecessary quote

  4. #4
    Registered User
    Join Date
    03-10-2016
    Location
    Hu
    MS-Off Ver
    2013
    Posts
    1

    Re: CDate fails to convert when system in different locale

    Thanks DonkeyOte! Saved my life, its a perfect solution Searched for tens of threads and forums, this was the only real answer.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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