+ Reply to Thread
Results 1 to 8 of 8

IsDate function looking for American Date

  1. #1
    Forum Contributor
    Join Date
    09-03-2008
    Location
    Somerset, England
    MS-Off Ver
    XP, 2003, 2007 - depends on location
    Posts
    185

    IsDate function looking for American Date

    Hey all,

    Got a random problem with the IsDate function and was wondering if anybody could help?

    Below is the code I am using to check a user input of a date, and if it is a recognised date put it in to a standard format (dd/mm/yyyy). The problem is that VBA is checking for an American format date -
    • My input - 15/08/09 (15th Aug 2009)
    • Read as 15th August 2009 and displayed as 15/08/2009, which is correct
    • But when my input - 07/08/09 (7th Aug 2009)
    • Read as 8th July 2009 and displayed as 08/07/2009
    This could be very problematic, so is there anyway of telling the IsDate function that the standard format is dd/mm/yyyy not mm/dd/yyyy?

    Please Login or Register  to view this content.
    Last edited by duckboy1981; 07-21-2009 at 05:05 AM.
    Ducks are better crispy...

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,998

    Re: IsDate function looking for American Date

    Format should read the date according to your regional settings. If those are US, then it will assume the date is mm/dd/yyyy originally.
    Everyone who confuses correlation and causation ends up dead.

  3. #3
    Forum Contributor
    Join Date
    09-03-2008
    Location
    Somerset, England
    MS-Off Ver
    XP, 2003, 2007 - depends on location
    Posts
    185

    Re: IsDate function looking for American Date

    That was my first thought as well, but all of our terminal servers have the correct regional settings on them.

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,998

    Re: IsDate function looking for American Date

    I can't help you there, I'm afraid. I don't touch TS, Citrix or any of that stuff.

  5. #5
    Forum Contributor
    Join Date
    09-03-2008
    Location
    Somerset, England
    MS-Off Ver
    XP, 2003, 2007 - depends on location
    Posts
    185

    Re: IsDate function looking for American Date

    Not a problem, was just wondering if it was anything within VBA that could be altered to fix it.

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: IsDate function looking for American Date

    I would not rely on a user's input into a textbox for a date. I use comboboxes to choose from

    DateCombos.zip
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  7. #7
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,998

    Re: IsDate function looking for American Date

    Nope. VBA functions use your regional settings (except when writing back to a worksheet). No way to change that, so I would have to say something in your TS is not set up correctly.

  8. #8
    Forum Contributor
    Join Date
    09-03-2008
    Location
    Somerset, England
    MS-Off Ver
    XP, 2003, 2007 - depends on location
    Posts
    185

    Re: IsDate function looking for American Date

    Good point Roy, I'll set that up and give it a try. Thanks both.

+ 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