+ Reply to Thread
Results 1 to 6 of 6

VBA Dates in correct format (dd/mm/yyyy) on form but incorrect when inserted to worksheet?

  1. #1
    Registered User
    Join Date
    06-18-2012
    Location
    Leamington SPa
    MS-Off Ver
    Excel 2010
    Posts
    6

    VBA Dates in correct format (dd/mm/yyyy) on form but incorrect when inserted to worksheet?

    Hi Everyone,

    I'm sure that this is something simple that I am doing wrong but it is driving me to distraction.

    I have a form on which I select a date (using a calendar form) and on the form it works perfectly. The date is in the correct dd/mm/yyyy format for example (03/04/2013 - 3rd April 2013), I then insert this date into a worksheet and it comes out in the correct format, but it is actually turning the dates around so where it should be putting 3rd of April (03/04/2013), it's inserting 4th March (04/03/2013) instead. It looks very much like the form sees the date in dd/mm/yyyy format and the worksheet when taking the data from the form thinks it in US format (mm/dd/yyyy).

    This renders it completely useless. I have posted part of my code below, please help me understand what mistake I am making.

    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    01-28-2013
    Location
    Bristol, UK
    MS-Off Ver
    Excel 2013
    Posts
    29

    Re: VBA Dates in correct format (dd/mm/yyyy) on form but incorrect when inserted to worksh

    Assume this won't be the issue, but is your MS Office setup as UK country for default date, time format in Control Panel? (Tends to default to US date formats and languages).

    Also can see from the code you're referencing a network(?) drive R:\...is that server setup as English UK?

  3. #3
    Registered User
    Join Date
    01-28-2013
    Location
    Bristol, UK
    MS-Off Ver
    Excel 2013
    Posts
    29

    Re: VBA Dates in correct format (dd/mm/yyyy) on form but incorrect when inserted to worksh

    Assume this won't be the issue, but is your MS Office setup as UK country for default date, time format in Control Panel? (Tends to default to US date formats and languages).

    Also can see from the code you're referencing a network(?) drive R:\...is that server setup as English UK?

  4. #4
    Registered User
    Join Date
    01-28-2013
    Location
    Bristol, UK
    MS-Off Ver
    Excel 2013
    Posts
    29

    Re: VBA Dates in correct format (dd/mm/yyyy) on form but incorrect when inserted to worksh

    Assume this won't be the issue, but is your MS Office setup as UK country for default date, time format in Control Panel? (Tends to default to US date formats and languages).

    Also can see from the code you're referencing a network(?) drive R:\...is that server setup as English UK?

  5. #5
    Forum Contributor
    Join Date
    01-02-2007
    Location
    Australia NSW
    MS-Off Ver
    2013
    Posts
    494

    Re: VBA Dates in correct format (dd/mm/yyyy) on form but incorrect when inserted to worksh

    Try
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    06-25-2014
    Location
    Denmark
    MS-Off Ver
    365 (Win and Mac)
    Posts
    20

    Re: VBA Dates in correct format (dd/mm/yyyy) on form but incorrect when inserted to worksh

    Hey Coreytroy.

    Thx for det fix. It worked well for me..

+ 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