+ Reply to Thread
Results 1 to 8 of 8

VBA Form is sumbitting dates as USA Format - I need UK format

  1. #1
    Registered User
    Join Date
    07-01-2014
    Location
    Trowbridge, England
    MS-Off Ver
    2007
    Posts
    22

    VBA Form is sumbitting dates as USA Format - I need UK format

    HI There,

    I have created a VBA Userform in Excel which on the whole works great.

    My problem is I am new to VBA and must be doing something wrong as I cannot fathom out how to get the form to submit a date in UK format. I can type a date into my Excel worsheet cell and it is correct, but when I use the form to "submit" into the same field it does so in USA format.

    I am currently using a text box: Me.txtNextDate.Value which simply updates a field in the datasheet.

    Is there a way to either globally control all of the dates to UK format, or is there a way to format the text field so that it populates the datasheet correctly in the UK format?

    Many thanks in advance

    Scott

  2. #2
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: VBA Form is sumbitting dates as USA Format - I need UK format

    try this
    Please Login or Register  to view this content.
    Regards, John55
    If you have issues with Code I've provided, I appreciate your feedback.
    In the event Code provided resolves your issue, please mark your Thread as SOLVED.
    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

    ...enjoy -funny parrots-

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

    Re: VBA Form is sumbitting dates as USA Format - I need UK format

    Scott

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

  4. #4
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,523

    Re: VBA Form is sumbitting dates as USA Format - I need UK format

    Would this happen to make a difference?
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    07-01-2014
    Location
    Trowbridge, England
    MS-Off Ver
    2007
    Posts
    22

    Re: VBA Form is sumbitting dates as USA Format - I need UK format

    Hi John,
    Apologies for the delay in responding.

    Where do I put this line of code? My current line of code which inserts the data is this: ".Cells(iRow, 4).Value = Me.txtLastUpdated.Value"

    Many thanks

  6. #6
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: VBA Form is sumbitting dates as USA Format - I need UK format

    perhaps
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    07-01-2014
    Location
    Trowbridge, England
    MS-Off Ver
    2007
    Posts
    22

    Re: VBA Form is sumbitting dates as USA Format - I need UK format

    Thanks John - it did the trick. Much appreciated.

    cheers
    Scott

  8. #8
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: VBA Form is sumbitting dates as USA Format - I need UK format

    you're welcome!

+ 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. Replies: 5
    Last Post: 07-09-2014, 01:29 PM
  2. [SOLVED] Search and Update Records in User Form changing dates to US Format in Spreadsheet
    By JTResearch in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-20-2013, 06:48 AM
  3. Replies: 8
    Last Post: 12-15-2012, 02:01 PM
  4. Make Dates format as Dates and Numbers format as numbers
    By Mr.WalterJones in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-17-2012, 05:23 PM
  5. CONVERT DATES FROM EUROPEAN FORMAT TO US FORMAT
    By les8 in forum Excel - New Users/Basics
    Replies: 13
    Last Post: 08-08-2006, 12:50 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