+ Reply to Thread
Results 1 to 12 of 12

"Dates" issue with US settings versus Dutch settings

  1. #1
    Forum Contributor
    Join Date
    07-26-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2016 Office 365 ProPlus
    Posts
    826

    "Dates" issue with US settings versus Dutch settings

    Ok so my windows has Dutch regional settings, some of my colleagues have US settings.
    Following should work in either situation.

    Please see excel attached.
    There is a column (A) with date time and AM/PM CET setup.

    I need to lose the CET (with replace that is easy) so excel will see the field as a normal date field.

    However after this (see column D) the lines with Feb nicely go to a "8-2-2019" format, however for me the line with 11-Mar-2019 will not convert as month 3 would not be Mar but Mrt in my settings.

    How can I get this to work without regional settings being an issue?
    Thanks.
    Attached Files Attached Files

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: "Dates" issue with US settings versus Dutch settings

    Hi,

    Try

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    and format the cell as "*dd-mmm-yyyy hh:mm:ss AM/PM"
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Contributor
    Join Date
    07-26-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2016 Office 365 ProPlus
    Posts
    826

    Re: "Dates" issue with US settings versus Dutch settings

    Hi Richard thanks.
    Formula seems to work (if you look with the wizard) but still no output (#Value) also when I customize the formatting of the cell to what you suggest.

    However I would like to have a VBA solution for this as it is a part of a bigger macro

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: "Dates" issue with US settings versus Dutch settings

    Often we'd use VBA to write the formula I gave you, but first I need to understand why the formual isn't giving you the date/time, particularly since you say the Evluate functionality IS working.

    Would you upload the workbook which is showing the error.

  5. #5
    Forum Contributor
    Join Date
    07-26-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2016 Office 365 ProPlus
    Posts
    826

    Re: "Dates" issue with US settings versus Dutch settings

    Sure now problem I will upload it with your formula in it.
    It works for the Feb months not for Mar.

    Please note the timevalue part would not be necessary.
    Focus is only on the date part.
    Just want simple dates.
    Attached Files Attached Files

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: "Dates" issue with US settings versus Dutch settings

    OK,

    Try

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    If I need to use VBA to apply this to a column of dates I generaly hold the formula in a hidden cell, give it a name and then in VBA use something like

    Please Login or Register  to view this content.
    Obviously you'd use a VBA variable to determine the relevant range, i.e. B1:B10 in this example.

  7. #7
    Forum Contributor
    Join Date
    07-26-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2016 Office 365 ProPlus
    Posts
    826

    Re: "Dates" issue with US settings versus Dutch settings

    This gives indeed a date converted to numbers

    But (sorry) now the Month is first in the cell 3-11-2019. Can we change it so the day will come first? 11-3-2019

  8. #8
    Forum Contributor
    Join Date
    07-26-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2016 Office 365 ProPlus
    Posts
    826

    Re: "Dates" issue with US settings versus Dutch settings

    Ok think the formula is not working correct.
    Added some dates where the day is higher then 12 (months in a year) and then he does do strange things (see file)
    Attached Files Attached Files

  9. #9
    Valued Forum Contributor dotchiejack's Avatar
    Join Date
    05-21-2015
    Location
    Antwerp,Belgium
    MS-Off Ver
    2016
    Posts
    507

    Re: "Dates" issue with US settings versus Dutch settings

    What about?
    Select the dates you want to change and run this macro.
    Code goes in a normal module.
    Please Login or Register  to view this content.
    Click the * Add Reputation below to say thanks.

  10. #10
    Forum Contributor
    Join Date
    07-26-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2016 Office 365 ProPlus
    Posts
    826

    Re: "Dates" issue with US settings versus Dutch settings

    Thanks dotchiejack.
    But the formula already gives the wrongs date.

    See 18-Mar-2019 it makes 3-6-2020, so then running your macro maybe would change the order but it would still be the wrong date.

  11. #11
    Forum Contributor
    Join Date
    07-26-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2016 Office 365 ProPlus
    Posts
    826

    Re: "Dates" issue with US settings versus Dutch settings

    Went for a walk and when back dissected your initial formula Richard.
    And was able to swap month with day

    Think this will do the trick in the rest of my macro.
    Thanks!

  12. #12
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: "Dates" issue with US settings versus Dutch settings

    Hi,

    Try the following UDF
    Please Login or Register  to view this content.

+ 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. [SOLVED] Difficult macro to change regional settings from "Windows Compatibile" to US
    By jaryszek in forum Excel Programming / VBA / Macros
    Replies: 29
    Last Post: 02-01-2019, 02:55 PM
  2. [SOLVED] Where's the "Custom User Title" in Excel profile settings
    By GraeagleBill in forum Excel General
    Replies: 5
    Last Post: 01-08-2018, 06:47 AM
  3. Make permantent changes to Word "options" settings
    By Mallycat in forum Word Formatting & General
    Replies: 3
    Last Post: 04-21-2012, 04:31 AM
  4. Replies: 0
    Last Post: 12-07-2008, 01:25 PM
  5. [SOLVED] using "transparency" option on chart settings
    By Mike D in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 12-03-2005, 12:35 AM
  6. [SOLVED] How can I Copy "Page Setup" Settings between Workbooks
    By CJPodd in forum Excel General
    Replies: 2
    Last Post: 09-16-2005, 12:58 PM
  7. Deleting "Share Log" Filters & Print Settings for prior users
    By Nodak in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-10-2005, 09:06 AM

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