+ Reply to Thread
Results 1 to 10 of 10

Userform date entered in UK format but showing in US Format in spreadsheet

  1. #1
    Forum Contributor
    Join Date
    07-02-2013
    Location
    abbots langley
    MS-Off Ver
    Excel 2010
    Posts
    325

    Userform date entered in UK format but showing in US Format in spreadsheet

    Hi

    Hoping somene can help.

    A userofrm was created for me and I believe it was created in America and as a result the date ,whilst it is entered in UK format, transfers to the spreadsheet in US format. I have tried the MDY in Text to columns but it does not work.

    Does anyone have any suggestions please.

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

    Re: Userform date entered in UK format but showing in US Format in spreadsheet

    In the code that puts the date on the worksheet try using CDate or DateValue.

    That should convert to a 'real' date which you can format as you like - it'll probably be UK format by default.

    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    07-02-2013
    Location
    abbots langley
    MS-Off Ver
    Excel 2010
    Posts
    325

    Re: Userform date entered in UK format but showing in US Format in spreadsheet

    Hi Norie

    Thanks for responding both of those return a value of "False"

    Sheet3.Cells(erow, 25).Value = UserForm2.tbxCycle1.Value = DateValue(tbxCycle1.Value)
    Any ideas?

  4. #4
    Forum Contributor
    Join Date
    07-02-2013
    Location
    abbots langley
    MS-Off Ver
    Excel 2010
    Posts
    325

    Re: Userform date entered in UK format but showing in US Format in spreadsheet

    oops sussed it sorry written the code wrong!

    Sheet3.Cells(erow, 25).Value = DateValue(UserForm2.tbxCycle1.Value)
    Thanks for the help

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

    Re: Userform date entered in UK format but showing in US Format in spreadsheet

    Eh, this doesn't really look like the example code I posted.
    Please Login or Register  to view this content.
    It should be.
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    07-02-2013
    Location
    abbots langley
    MS-Off Ver
    Excel 2010
    Posts
    325

    Re: Userform date entered in UK format but showing in US Format in spreadsheet

    Hi Norie

    DO you know how i adapt the code below to do the same, i have tried but keep getting an error.

    Please Login or Register  to view this content.
    Many thanks

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

    Re: Userform date entered in UK format but showing in US Format in spreadsheet

    So you want the date from the sheet in the textbox with the same format as on the sheet?
    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    07-02-2013
    Location
    abbots langley
    MS-Off Ver
    Excel 2010
    Posts
    325

    Re: Userform date entered in UK format but showing in US Format in spreadsheet

    Thats it worked perfectly thankyou Norie.

  9. #9
    Forum Contributor
    Join Date
    07-02-2013
    Location
    abbots langley
    MS-Off Ver
    Excel 2010
    Posts
    325

    Re: Userform date entered in UK format but showing in US Format in spreadsheet

    Hi Norie

    Any idea why this would give me a runtime 13 error

    Please Login or Register  to view this content.

  10. #10
    Forum Contributor
    Join Date
    07-02-2013
    Location
    abbots langley
    MS-Off Ver
    Excel 2010
    Posts
    325

    Re: Userform date entered in UK format but showing in US Format in spreadsheet

    Should have said the text box is called "TextBoxMeetingDate"

+ 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. Date format on UserForm changes on Spreadsheet
    By darthelvis in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-12-2013, 05:41 PM
  2. [SOLVED] Userform displays in (MM/DD/YYY) format, when spreadsheet stores as (DD/MM/YYYY) format
    By david1987 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-27-2012, 10:39 AM
  3. Use spreadsheet cell format to set userform text box format - how?
    By barryleajo in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-08-2010, 07:17 AM
  4. Copying date values from Userform to Spreadsheet keeping same format
    By mhuddles1981 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-12-2010, 01:53 AM
  5. Userform date format reverting back to us format on change event
    By jpruffle in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-10-2009, 12:34 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