+ Reply to Thread
Results 1 to 14 of 14

Userform changing date format to American

  1. #1
    Forum Contributor
    Join Date
    08-04-2008
    Location
    West Calder, Scotland
    MS-Off Ver
    365
    Posts
    418

    Userform changing date format to American

    Good Monring Folk

    I have a userform that picks up a date, in UK format e.g 11/12/2013, from a cell when it opens using this code, this is how it should be

    Please Login or Register  to view this content.
    When the user puts additional information into the form and saves it the date is being changed to the American format 12/11/2013 in the new cell, the code for this part of the operation is

    Please Login or Register  to view this content.
    full code below, I can't understand why the format is being changed. Can someone please point out if and where I went wrong and why its changing the format as I need it to remain in the UK format

    Please Login or Register  to view this content.
    Many thanks for your help

  2. #2
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Userform changing date format to American

    Hi,

    Check your regional and language settings in the control panel of your computer. This might be set to United States.
    Happy Computing ,

    Xlbiznes.

    To show your appreciation please click *

  3. #3
    Forum Contributor
    Join Date
    08-04-2008
    Location
    West Calder, Scotland
    MS-Off Ver
    365
    Posts
    418

    Re: Userform changing date format to American

    HI xlbiznes

    Thank you for your reply

    Its not that,,, I also have dates for other things,, another userform in the same workbook also saves dates directly into a cell for me and this is OK... it is only this one form that is doing it and it is only this date, the other date "repdate" in the same form saves in the UK format. I think it has something to do with picking up a date from a cell and saving it to another cell as this is the only thing that is different from the rest.... I have checked the formatting in the destination cells and they are set from UK

    Many thanks
    Last edited by JamesT1; 12-11-2013 at 06:11 AM.

  4. #4
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Userform changing date format to American

    What happens when you put 13/12/2013 ?

  5. #5
    Registered User
    Join Date
    11-24-2012
    Location
    Stratford-upon-Avon
    MS-Off Ver
    Excel 2007
    Posts
    89

    Re: Userform changing date format to American

    Put this in the Private Sub of the text box (below I have called it txt.date) you use to populate the cell in the worksheet:

    Please Login or Register  to view this content.

  6. #6
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Userform changing date format to American

    Hi,

    i tried simulating your issue and this works fine on my pc.

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    08-04-2008
    Location
    West Calder, Scotland
    MS-Off Ver
    365
    Posts
    418

    Re: Userform changing date format to American

    Now I'm really confused... type directly into the destination cell and the format is fine.... use the form and put in todays or a previous date and it converts it to the American format however if I put in a future date it is in UK format

  8. #8
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Userform changing date format to American

    You can try changing your code :

    Please Login or Register  to view this content.
    to

    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    08-04-2008
    Location
    West Calder, Scotland
    MS-Off Ver
    365
    Posts
    418

    Re: Userform changing date format to American

    xlbiznes/Stratfordoaks

    May thanks for your help guys,,,,, I've tried fomrating everything I can think of and used the advice from you but nothing will stop this changing to the US format in the cell....... Ive used a workround in the mean time,,, I needed it in UK format as another cell references the column for individual months,, i've changed this to reference days which gives me the same result for this format.....

    many thanks

  10. #10
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Userform changing date format to American

    You may use:
    Please Login or Register  to view this content.

  11. #11
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Userform changing date format to American

    Just posting what one of the forum guru @Norie has stated in an another thread.

    Instead of Value use Text, then you'll get the value as it's formatted.

  12. #12
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Userform changing date format to American

    The Text property may not be written - it may only be read.

  13. #13
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Userform changing date format to American

    Or:
    Please Login or Register  to view this content.

  14. #14
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Userform changing date format to American

    xlbzines

    That's for getting a value from a cell as it's formatted.
    If posting code please use code tags, see here.

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

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