+ Reply to Thread
Results 1 to 6 of 6

Date always reverts to American format in Userform

  1. #1
    Registered User
    Join Date
    07-24-2013
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    73

    Date always reverts to American format in Userform

    Dear all,
    I have a problem with american date formats always reoccuring. I have seen other posts on this problem but none matching my particular issue.

    I have a userform in which my users enter data which is then added to the excel spreadsheet.
    Sometimes they need to amend this data so we have made their data editable - it gets put back into the userform so that changes can be made.

    The issue is with dates. These are entered as dd/mm/yyyy but when they are then added to the userform they always go back to mm/dd/yyyy

    The code to put the userfrom data to the spreadsheet is as follows:

    Please Login or Register  to view this content.
    ...Then to put it back into the form for editing:

    Please Login or Register  to view this content.
    I made some progress by specifying instead of the first line:

    Please Login or Register  to view this content.
    Using DataValue or CDate. This works to an extent because data is now added in the format dd/mm/yyyy - hooray!

    However, when put back into the userform it still goes back in the form mm/dd/yyyy!!!!

    Is there a way I can override this American date format which keeps coming back?

    Many thanks in advance

    Henry

    Linked: http://www.mrexcel.com/forum/excel-q...ml#post4592462
    Last edited by henryBukowski; 08-01-2016 at 05:30 AM.

  2. #2
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Date always reverts to American format in Userform

    Hello henryBukowski,

    See this link as well: http://www.ozgrid.com/forum/showthread.php?t=195857

    Regards.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  3. #3
    Registered User
    Join Date
    06-06-2016
    Location
    Hampshire
    MS-Off Ver
    2013
    Posts
    19

    Re: Date always reverts to American format in Userform

    Hi,
    to read a date from your range in to a textbox and kept its format, use the Range.Text property.

    Please Login or Register  to view this content.
    this should return what you see in the cell.

    Dave

  4. #4
    Registered User
    Join Date
    07-24-2013
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    73

    Re: Date always reverts to American format in Userform

    Thanks both for the input.

    Winon, I didn't understand every part of the code you linked to but I tried the following:

    Please Login or Register  to view this content.
    Needless to say I failed! Is that as lame an attempt as I suspect it was on my part?


    Hey dmt32, that is actually very helpful - Can't actually tell if it works yet because my userform is now putting all data into the spreadsheet as mm/dd/yyy to begin with so that obviously going back the other way it is still in the wrong format.

    Problem is my
    Please Login or Register  to view this content.
    code has started throwing up mismatch errors so I scrapped it and I'm back to square one!

  5. #5
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Date always reverts to American format in Userform

    Hi henryBukowski,

    Thank you for the feedback.

    I think we all seem to get lost between all these snippets of Code, and maybe we would be able to help you if you could attach a sample workbook to see exactly where and how you have your Code stacked.

    Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  6. #6
    Registered User
    Join Date
    02-18-2015
    Location
    United States
    MS-Off Ver
    2013
    Posts
    25

    Re: Date always reverts to American format in Userform

    Quote Originally Posted by henryBukowski View Post
    Dear all,
    I have a problem with american date formats always reoccuring. I have seen other posts on this problem but none matching my particular issue.

    I have a userform in which my users enter data which is then added to the excel spreadsheet.
    Sometimes they need to amend this data so we have made their data editable - it gets put back into the userform so that changes can be made.

    The issue is with dates. These are entered as dd/mm/yyyy but when they are then added to the userform they always go back to mm/dd/yyyy

    The code to put the userfrom data to the spreadsheet is as follows:

    Please Login or Register  to view this content.
    ...Then to put it back into the form for editing:

    Please Login or Register  to view this content.
    I made some progress by specifying instead of the first line:

    Please Login or Register  to view this content.
    Using DataValue or CDate. This works to an extent because data is now added in the format dd/mm/yyyy - hooray!

    However, when put back into the userform it still goes back in the form mm/dd/yyyy!!!!

    Is there a way I can override this American date format which keeps coming back?

    Many thanks in advance

    Henry

    Linked: http://www.mrexcel.com/forum/excel-q...ml#post4592462
    All you have to do is format the date from the cell with the format you want on load or however you activate it like so:

    Please Login or Register  to view this content.
    Let me know if this is what you want.

+ 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] Date changing to American format
    By JamesT1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-12-2015, 10:17 AM
  2. Userform changing date format to American
    By JamesT1 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 12-11-2013, 10:05 AM
  3. Extracting Time from American Date+Time format
    By Perkins20 in forum Excel General
    Replies: 5
    Last Post: 07-09-2012, 06:57 AM
  4. Date Converted to American Format
    By TimTDP in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-17-2011, 02:32 PM
  5. Why is the date changing to American Format
    By darbid in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-07-2010, 10:00 AM
  6. American/British Date format issue
    By hriggs in forum Excel General
    Replies: 4
    Last Post: 05-29-2008, 08:09 AM
  7. [SOLVED] text or american date format
    By Marshall Scmidt in forum Excel General
    Replies: 2
    Last Post: 03-24-2006, 02:55 PM

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